Loading a new XML file when printing Crystal Reports

got some help here last week regarding printing with dll office.interop. My application is required for printing data from new database records in a report style format, I successfully did this using the office.interop functions, however I never thought that you would need an office that will be installed on the computer for it to work, so after With a little research, I realized that the only realistic way is to use Crystal Reports if anyone has no other suggestion?

So the question is: I have successfully configured Crystal Report to read from XML files for generation, and it works fine, I can not print it without problems. I generate XML files by populating the data set with data pulled from the mySql database in the main code of my program, however, even when I add new information that generates the XML file again and overwrites the previous one, the report still prints the original XML file, which I used to create a report. So I'm wondering if there is a way to get the report to update its data and pull the details out of the XML file again before printing.

I tried .Refresh () in the report before the print function, however I get a database error and do not print anything.

Here is the code I use to print the report:

checkInReceipt cir = new checkInReceipt(); cir.Refresh(); // if i leave this in, it generates a db error, take it out and it prints data from an old XML file. cir.PrintToPrinter(1, true, 1, 1); 
+4
source share

All Articles