|
Hi,
I need a help urgently, if any one can sort it out... I want to display the winforms datagrid dataset into
(1) pdf file
or
(2) on Microsoft Report Viewer control using RDLC.
I have a screen that displays two different dataset with two different datagrid. Using that screen results, I have to print or convert it into the PDF file...
......
Kind Regards,
Madhusudan Kushwaha
|
|
|
|
|
Just a little tip: if you say your problem is urgent, it will get ignored.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Hi, my friends.
I have a question with my web services. he have two functions, the intellisense in the windows application show me this function whit the parameters of each one. But it does,t work.
The error message is terrible:
System.Web.Services.Protocols.SoapException was unhandled
Message="System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: Cannot serialize the DataTable. DataTable name is not set.\n at System.Data.DataTable.WriteXmlSchema(XmlWriter writer, Boolean writeHierarchy)\n at System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter writer)\n at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)\n at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write1_SearchResponse(Object[] p)\n...........and much more.
thanks.
|
|
|
|
|
What is the return type of the webmethod ??
Was it working separately as a function ??
Sathy
|
|
|
|
|
thanks Sathy.
the function in the services return a datatable, but in the application if I do:
DataTable appsearch = new DataTable();
appsearch = serv.Search(var1,var2);
fail in build with the error message:
Cannot implicity convert
type 'Client.localhost.SearchResponseSearchResult' to 'System.Data.DataTable'
what that mean? please.
|
|
|
|
|
Ok in that case - the Webmethod is returning the type SearchResponseSearchResult which will have some series of properties (you'll probably find that the datatable is one of them), if you are using VStudio you can use object explorer to examine that object otherwise you'll be able to find the webservice proxy class to see the class definition of SearchResponseSearchResult . Then you should be able to do something like :
<br />
Client.localhost.SearchResponseSearchResult objResult = serv.Search(var1, var2);<br />
DataTable appsearch;<br />
<br />
if(objResult.DataTableProperty ! = null)<br />
{<br />
appsearch = objResult.DataTableProperty;<br />
}<br />
|
|
|
|
|
thanks a lot, Torsten Mauz.
I can do what you explain here but the DataTableProperty i don't have. I think this can be because i am working with a xml web service and also this is the reason why i have
System.XML.XmlElement[] SearchResponseSearchResult.Any
I dont now where this Any come from but i think i can use this XmlElement.
what you think?
Something else, in this web services i have another function boolean, this function return boolean in the application without any problem.
|
|
|
|
|
DataTable name is not set - kind of gives the game away. The webservice has issues that need resolving, i.e. the DataTable object they are trying to return needs to have it's TableName property set before it can be serialised. If you have access to the webservice code then you'll need to fix that. Otherwise you'll have to get in touch with whoever is responsible for the service.
HTH
|
|
|
|
|
the datatable name is set
|
|
|
|
|
How do you tell if a cell in DataGridView is empty?
foreach (DataGridViewRow r in theTableDataGridView.Rows)
{
richTextBox1.Text += r.Cells[1].Value.ToString() + " " + r.Cells[2].Value.ToString() + "\n";
if (r.Cells[3].Value.ToString() == null) { return; }
else { richTextBox1.Text += r.Cells[3].Value.ToString() + "\n" ; }
}
This doesnt work... ToString().Trim() does not work... I just can not figure it out.. in the database the default value is <dbnull>.
I just can not figure it out... Thanks in advance!
|
|
|
|
|
how about r.Cells[3].Value == null || r.Cells[3].Value.ToString().Length == 0 ?
Last modified: 2mins after originally posted -- fixed a bunch of syntax and logic errors
|
|
|
|
|
Jacob Dixon wrote: How do you tell if a cell in DataGridView is empty?
foreach (DataGridViewRow r in theTableDataGridView.Rows)
{
richTextBox1.Text += r.Cells[1].Value.ToString() + " " + r.Cells[2].Value.ToString() + "\n";
if (r.Cells[3].Value.ToString() == null) { return; }
else { richTextBox1.Text += r.Cells[3].Value.ToString() + "\n" ; }
}
This doesnt work... ToString().Trim() does not work... I just can not figure it out.. in the database the default value is .
I just can not figure it out... Thanks in advance!
You need to use DBNull.Value . A couple things, while we are at it. The way you formatted your string is ugly. This is 2008, format strings the right way . Use string.Format() . Also, in an if statement, put the constant on the left hand side. So in the end, you would want your code to look like this:
foreach (DataGridViewRow r in theTableDataGridView.Rows)
{
richTextBox1.Text += string.Format("{0} {1}\n", r.Cells[1].Value.ToString(), r.Cells[2].Value.ToString());
if (DBNull.Value == r.Cells[3].Value)
return;
else
richTextBox1.Text += string.Format("{0}\n", r.Cells[3].Value.ToString());
}
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Thanks! Sorry I'm still learning. Thanks that works... There is actually alot more to that. I just did not want to paste it all..
return; actually quits the foreach so I just left it blank. a semi-colon after the r.Cells[3].Value
It just goes through and list the address (its an address book I am working on). Like in this format:
Jacob Dixon
Address
City, State, Zip
Home Phone:
and such... I just didn't want a blank line to be entered if the cell was null.. Thanks for the help!
|
|
|
|
|
Jacob Dixon wrote: and such... I just didn't want a blank line to be entered if the cell was null.. Thanks for the help!
Ah, I see Happy to help
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Hi
how to get click events for dynamically generated buttons
help me with the code
thanx in advance.
modified on Friday, January 11, 2008 2:22:18 AM
|
|
|
|
|
Create instance for TextBox class, assign id an point, add that to Form.
|
|
|
|
|
Hello,
create a object of TextBox and add to the form like this way:
TextBox TxtBox = new TextBox();
this.Controls.Add(TxtBox);
U may set different location and other properties before or after add to controls collection.
Try it.
Best of luck!
Dipak
|
|
|
|
|
Thanx dipak
how to get Textchanged event for dynamically generated textbox
|
|
|
|
|
TextBox TxtBox = new TextBox();
TxtBox.TextChanged = \\Your event
this.Controls.Add(TxtBox);
Sathy
|
|
|
|
|
Hi,
all Controls are generated dynamically! When you use Visual Designer to add some Controls
to a Form, what really happens is the Designer adds code to some file
(such as myForm.Designer.cs) and that code gets executed by myForm's constructor.
So you can look at that code and see how it is done; you can write the same (or different)
code yourself.
|
|
|
|
|
how to check if a given xml file is well formed or not?
Gaurav
|
|
|
|
|
Easiest way might be just to open it in an XmlDocument - it will fail if it's not well formed I think....
|
|
|
|
|
wellformedness can be checked by the Browser itself. open the xml file in IE and you can find if it is wellformed or not. IE has a Parser(software for processing xml file)
Never Never Give up!
|
|
|
|
|
Is it possible to call a method from a library to the main program and if so how (see example). If it is not possible please let me know.
class Library1
{
// Cannot add reference to Exe
MethodA()
}
class Exe
{
// Reference to Library1
void MethodA()
{
a = b + c;
}
}
There is a reference to Library1 in Exe
I can not add a reference to Libray1 for Exe because I would get a circular reference therefore it can not see Exe. How can I solve this problem.
Thanks in advance,
Michael
|
|
|
|
|
You would have to delcare a delagate in the Library code - inform the Library of the Exe method which implements that delegate - i.e. have a method in the library which takes an instance of the Library delegate and then call that delegate from the library at the appropriate time....
|
|
|
|