Question on putting xml data into the report built from xml only

Stimulsoft Reports.NET discussion
Post Reply
Sacha
Posts: 19
Joined: Tue Mar 27, 2007 11:21 am
Location: Montréal

Question on putting xml data into the report built from xml only

Post by Sacha »

Hi !
As we continue to integrate StimulSoft in our product, we have 2 new questions.

1- We see you release new builds continuously and we were told that you had fixed an issue with images from text while text.lenght was 0. We would like to have that fix in our engine to have better stability, but we didn't find any procedure of how to install those dlls.

2- We create our reports templates using our exported xml data only. When we then use the template to populate the report with a new xml and send it to printer, it keeps showing the data that was used while making the template. The code i'm using right now is below, what else can i try to have the new data in the report instead of the old ? I write down the xml used for the printing in a file and the xml data is fine, it's the report that doesn't get it.

Thanks for your great support !
Sacha

**************
private static StiReport InitializeReport(MemoryStream xmlData, PrintSessionInfo sessionInfo)
{
StiReport stiReport = new StiReport();
StiOptions.Engine.GlobalEvents.GetValue += new Stimulsoft.Report.Events.StiGetValueEventHandler(OnGetValue);
StiOptions.Engine.HideExceptions = false;
StiOptions.Engine.HideMessages = false;
StiOptions.Engine.LogEnabled = true;
StiOptions.Engine.TraceEnabled = true;
xmlData.Position = 0;
DataSet dataset = new DataSet();
dataset.ReadXml(xmlData);
stiReport.Load(sessionInfo.SummaryReportPath);
stiReport.Dictionary.DataStore.Clear();
stiReport.RegData(dataset);
stiReport.Dictionary.Synchronize();

//Set page orientation if not a custom report
if(!sessionInfo.IsCustomSummaryReport)
{
foreach(StiPage page in stiReport.Pages)
{
page.Orientation = sessionInfo.IsLandscape ? StiPageOrientation.Landscape : StiPageOrientation.Portrait;
}
}
stiReport.PrinterSettings.ShowDialog = false;
stiReport.Compile();
stiReport.CompiledReport.Rendering += new EventHandler(OnRendering);
stiReport.Render(false);
return stiReport;
}

And then call print on the report.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Question on putting xml data into the report built from xml only

Post by Vital »

1- We see you release new builds continuously and we were told that you had fixed an issue with images from text while text.lenght was 0. We would like to have that fix in our engine to have better stability, but we didn't find any procedure of how to install those dlls.
For installing the build you should copy all files to Program Files\Stimulsoft\StimulReport.Net\Demo\Bin\.
After then you have to update files in GAC.
2- We create our reports templates using our exported xml data only. When we then use the template to populate the report with a new xml and send it to printer, it keeps showing the data that was used while making the template. The code i'm using right now is below, what else can i try to have the new data in the report instead of the old ? I write down the xml used for the printing in a file and the xml data is fine, it's the report that doesn't get it.
If i right understand you are use Connection to xml data in report for design report template. So you need remove this connection from report. Please use following code:

Code: Select all

stiReport.Dictionary.Databases.Clear();
Thank you.
Sacha
Posts: 19
Joined: Tue Mar 27, 2007 11:21 am
Location: Montréal

Question on putting xml data into the report built from xml only

Post by Sacha »

In the previous code, i replaced
stiReport.Dictionary.DataStore.Clear();
by
stiReport.Dictionary.Databases.Clear();

and left the rest as is

now my reports are totally empty :) it didnt get what was in my xml

Any other idea ?
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Question on putting xml data into the report built from xml only

Post by Vital »

Please use following code:

Code: Select all

DataSet dataset = new DataSet();
dataset.ReadXml(xmlData);
stiReport.Load(sessionInfo.SummaryReportPath);
stiReport.Dictionary.DataStore.Clear();
stiReport.Dictionary.Databases.Clear();
stiReport.RegData("NameOfMyXmlDatabase", dataset);//Instead "NameOfMyXmlDatabase" you need use name of xml design data in report dictionary
stiReport.Dictionary.Synchronize();
Thank you.
Sacha
Posts: 19
Joined: Tue Mar 27, 2007 11:21 am
Location: Montréal

Question on putting xml data into the report built from xml only

Post by Sacha »

Thanks, it fixes the population of the report by our xml :)

but now, the bottom of the pages are wrong, like if they didn't had enough space suddenly and print on top of each others and the footer don't appear anymore.

Does the manipulation we just did reseted something that should reinitialize after ?
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Question on putting xml data into the report built from xml only

Post by Vital »

Please send your report to support [at] stimulsoft [dot] com. For also please send us result of export report to pdf file.

Thank you.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Question on putting xml data into the report built from xml only

Post by Vital »

First way:
1. Please set property LargeHeight of page to true. This property give you additional height in report designer.

2. Place to Page1 DataBand. Set property CountData to 1. To this DataBand move Container8 and Container6. Instead DataBand you can use additional PageHeaderBand .

Second way:

Move all components from PageHeader and PageFooter directly to page.

Third way:

Decrease size of PageFooterBand.

Thank you.
Post Reply