|
blochri wrote: oWordTable.Range.Cells[iRowIndex].Range.Text.ToString().
This really irks me. The Text property is already a String, so calling ToString on a String is pretty pointless.
Your getting the Text of the document using the Text property. You don't automatically get RTF coded text when you use the Text property. Even if it was an RTF document, you have to get the RichText, not the Text.
Also, RTF does not support all the formatting capability of Word. If, in Word, you save the document as an RTF document and lose the formatting, chances are really good that RTF doesn't support what you're trying to get.
|
|
|
|
|
Thanks Dave, Yes, I need to get the Rich Text from a cell in a word table, but I can't figure out how to get the Rich Text, do you know how to do this?
|
|
|
|
|
OKm unless I'm missing something in the description of this document, there is no rich text to get from it. Internally, in Word, there is no rich text representation of a document. The only time Word works with rich text is when you save a document and the save filter builds the rich text file.
|
|
|
|
|
OK, thanks again Dave for your thoughts on this issue. I'm trying another approach or selecting and saving the rich text via the clipboard and a Rich TExt Box, we'll see how that goes.
Thanks again
Bill
|
|
|
|
|
Hi Everyone
I'm new to ASP.NET and am having trouble with my project. I am building it using Visual Web Developer 2008 Express. Language C#.
I have a gridview linked to a LinqDataSource. I want to add a search facility to the gridview as the database that is linked to it contains a lot of entries.
I downloaded the code from your site for the control to do this and altered everything to meet my specifications. Everything seems to work except that the gridview still remains the same with the original entries showing instead of showing the filtered entries.
The gridview shows four columns from the database table.
Hope someone out there can she some light on this as I'm pulling my hair out.
Thanx in anticipation
Andy
My code behind code is this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
public partial class Controls_PinsSearch : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void lbtnBasicSearch_Click(object sender, EventArgs e)
{
string sSearchText = GetBasicSearchString();
OnSearch(sSearchText);
lbtnCancelBasicSearch.Visible = true;
}
protected string GetBasicSearchString()
{
StringBuilder sb = new StringBuilder(string.Empty);
string sBasicSearchText = txtBasicSearch.Text.Trim();
if (sBasicSearchText == string.Empty)
return string.Empty;
string sFirstName = GetSearchFormattedFieldString("FirstName", sBasicSearchText, string.Empty, true);
sb.Append(sFirstName);
sb.Append(" OR ");
string sLastName = GetSearchFormattedFieldString("LastName", sBasicSearchText, string.Empty, true);
sb.Append(sLastName);
sb.Append(" OR ");
string sPinCode = GetSearchFormattedFieldString("PinCode", sBasicSearchText, string.Empty, true);
sb.Append(sPinCode);
sb.Append(" OR ");
string sFilter = GetSearchFormattedFieldString("Filter", sBasicSearchText, string.Empty, true);
sb.Append(sFilter);
sb.Append(" OR ");
string sSearch = sb.ToString();
return sSearch;
}
protected string GetSearchFormattedFieldString(string sfield, string value, string soperator, bool bForceStringType)
{
if (value.Trim() == string.Empty)
return string.Empty;
string _newValue = value.Trim();
string _operator = "=";
if (soperator != string.Empty)
_operator = soperator;
if (bForceStringType == false)
{
}
return _newValue;
}
public delegate void SearchEventHandler(string _SearchText);
public event SearchEventHandler Search;
protected virtual void OnSearch(string _SearchText)
{
if (Search != null)
{
Search(_SearchText);
}
}
protected void lbtnCancelBasicSearch_Click(object sender, EventArgs e)
{
txtBasicSearch.Text = string.Empty;
OnSearch(string.Empty);
lbtnCancelBasicSearch.Visible = false;
}
}
The markup code for the control is:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PinsSearch.ascx.cs" Inherits="Controls_PinsSearch" %>
<asp:Panel ID="pnlBasicSearch" runat="server" Width="100%">
<table>
<tr>
<td>
<asp:Label ID="lblBasicSearch" runat="server" Text="Search for:" ></asp:Label>
</td>
<td>
<asp:TextBox ID="txtBasicSearch" runat="server" Text="" MaxLength="50" Width="255px" />
</td>
<td>
<asp:LinkButton runat="server" ID="lbtnBasicSearch" CausesValidation="False" Text="Search" OnClick="lbtnBasicSearch_Click" />
</td>
<td>
<asp:LinkButton runat="server" ID="lbtnCancelBasicSearch" CausesValidation="False" Visible="false" Text="Cancel" OnClick="lbtnCancelBasicSearch_Click" />
</td>
</tr>
<tr>
<td colspan="2" align="right">
</td>
<td colspan="2"></td>
</tr>
</table>
</asp:Panel>
|
|
|
|
|
Don't crosspost.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Hi everyone,
I know that this is not the right place to ask about this subject, bud i did'nt get a usefull answer somewhere else. So hopefully you guys can help me:
I have a reports generator winapp builded with Visual Studio 2005 en CrystalReports.
All reports generate dynamically with parameterfields.
My question is how to add charts programmatically on my report?
Thanks for reading.
|
|
|
|
|
Are you using the Crystal Reports that ships with Visual Studio.
If I remember correctly: You cannot add new report objects with that version. This kind of functionality is available in the separately licensed version. In the Visual Studio version you can only modify the properties of an existing object.
|
|
|
|
|
Hi Mika,
Thank you for reply. Can you give me any references of how to modify the properties of a chart programmatically?
Thanks.
|
|
|
|
|
|
I'm still not able to get this going. Because the items are in no specific order I still am getting duplicates.
ne1 have any suggestions???
I have a text string like this coming out of a database....
string nodeText = "name1:name2/name3.name4.name5.name6.name7";
that i want to load into a treeview. The first, second and third item will always be singular (just one on them) but all the other items will have multiple entrys. In a way you can look at it like name 1 and name 2 are the grandfather and grandmother. name 3 is the mother's name, name4 is 1 of her siblings. The sibling (name4) has children etc. This list can go on for generations.
I can parse the string to break the names up but I'm not sure how to recursivly add these to the treeview.
Any help would be greatly appreciated...
tia
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
modified on Wednesday, December 17, 2008 6:13 PM
|
|
|
|
|
You don't need recursion here. Once you have a string array that contains name3, name4, etc, step through them. At each step, search for te node with that name, if it exists, step in, if not, create it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am reading a couple of thousand entrys at a time from a database. I'm not adding to an existing tree I am building a new one on the fly.
I was trying to..
once i added name3 i wanted to add all if the name4 items that belonged to it.
Then all the name5's that belong to name4 etc.
I'm thinking recursion is the only efficient way of doing this. But I have been wrong before.
tia
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Recursion is a waste of time when you know in advance the number of steps you need to take.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Problem is...I don't know ahead of time the number of steps I need to take.
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
I am a new to use Chart Control, I have the following two questions:
1: How to select the object such as line in Chart with multiple Series, it seems that Chart Forum also has these questions, but no reply so far, anyone can give one idea for it?
2: It seems current Chart Control can not be used to plot true 3D charts, such as f(x,y,z), am I right? The so called 3D charts in the help files are not true 3D charts, I think.
thanks.
|
|
|
|
|
What Chart Control? There are a few around you know.
|
|
|
|
|
Pete O'Hanlon wrote: What Chart Control?
Did you leave your crystal ball at home again?
led mike
|
|
|
|
|
I am also new to the chart control but I have found out that you can have multiple series using the y axis.
If you look at the samples of code that came with the chart control there are many examples of doing what you are talking about.
Have a look at this site and download the samples.
http://code.msdn.microsoft.com/mschart[^]
hope this helps
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Does anyone know how I can get the current screen Color Quality. I can get the resolution but am stuck finding the quality.
Thanks
Michael
|
|
|
|
|
Hi,
the only way I am aware of is through P/Invoke, using
[DllImport("user32.dll")]
public static extern int EnumDisplaySettings (string deviceName,
int modeNum, ref DEVMODE1 devMode );
[StructLayout(LayoutKind.Sequential)]
public struct DEVMODE1 {
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)] public string dmDeviceName;
public short dmSpecVersion;
public short dmDriverVersion;
public short dmSize;
public short dmDriverExtra;
public int dmFields;
public short dmOrientation;
public short dmPaperSize;
public short dmPaperLength;
public short dmPaperWidth;
public short dmScale;
public short dmCopies;
public short dmDefaultSource;
public short dmPrintQuality;
public short dmColor;
public short dmDuplex;
public short dmYResolution;
public short dmTTOption;
public short dmCollate;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string dmFormName;
public short dmLogPixels;
public short dmBitsPerPel;
public int dmPelsWidth;
public int dmPelsHeight;
public int dmDisplayFlags;
public int dmDisplayFrequency;
public int dmICMMethod;
public int dmICMIntent;
public int dmMediaType;
public int dmDitherType;
public int dmReserved1;
public int dmReserved2;
public int dmPanningWidth;
public int dmPanningHeight;
};
with mode set to ENUM_CURRENT_SETTINGS (=-1)
|
|
|
|
|
SO I have to pass the Display card name to this function and then get the info from dmcolor?
If I don't know the Display card name and this is dunning on over 250 machine with different cards how do I get this info?
Thanks
|
|
|
|
|
I did provide you with some pointers and useful code.
For the details they invented a thing called documentation[^] which google will be happy to locate for you.
|
|
|
|
|
Thanks for your help. I've been googling all afternoon trying to find this info and understand it.
Hope you have a good evening.
|
|
|
|