XML Data and report with parameters
XML Data and report with parameters
hi!
Is it possible to add parameter if i make a report with type of connection "Xml Data"?
e.g. i have XSD and XML from your examples (Demo.xsd, Demo.xml) and i need to make a report in which the columns are retrieved by the following query : select * from Employees where EmployeeID > @EmployeeID
thanks
Is it possible to add parameter if i make a report with type of connection "Xml Data"?
e.g. i have XSD and XML from your examples (Demo.xsd, Demo.xml) and i need to make a report in which the columns are retrieved by the following query : select * from Employees where EmployeeID > @EmployeeID
thanks
XML Data and report with parameters
Hello,
Please use the filter of the databand or filter in datasource "Data from other datasource".
Thank you.
Please use the filter of the databand or filter in datasource "Data from other datasource".
Thank you.
XML Data and report with parameters
i don't know to add a "dinamically" parameter, but only parameter as constant in filter of the databand (@EmployeeID has to be input parameters entered by user). And when i used datasource "Data from other datasource" so i didn't know to use my xsd scheme.
(When i used datasource "Sql Connection" , i have no problem with this task.)
(When i used datasource "Sql Connection" , i have no problem with this task.)
XML Data and report with parameters
Hello,
Please see the sample report in attachment.
Thank you.
Please see the sample report in attachment.
Thank you.
- Attachments
-
- 802.SampleReport.mrt
- (18.47 KiB) Downloaded 622 times
XML Data and report with parameters
it's done...
thanks for helping me.
thanks for helping me.
XML Data and report with parameters
Hello,
Let us know if you need any additional help.
Thank you.
Let us know if you need any additional help.
Thank you.
XML Data and report with parameters
Thanks, I have another problem with variables in this report:
i have added a new variable with following parameters
Name: _DateVar
Type: datetime
Default Value: Today (selected from a list of system variables)
Read Only: false
Function: true
Request from User: false
This variable is used in filter of the databand:
Field Is: Expression
Membership.ExpirationDate > _DateVal
Report preview in Designer tool is ok, but i have a problem with report's execution in my app:
....
report.Load(......);
DataSet ds = new DataSet();
ds.ReadXmlSchema("SE.xsd");
ds.ReadXml("SE.xml");
report.Dictionary.DataStore.Clear();
report.Dictionary.Databases.Clear();
report.RegData("SE", ds);
report.Dictionary.Synchronize();
if (report.Dictionary.Variables.Contains("_DateVar"))
{
report.Dictionary.Variables["_DateVar"].ValueObject = new DateTime(2010, 10, 1);
}
report.Render(false);
report.ExportDocument(StiExportFormat.Pdf,"SE.pdf");
........
error is on line report.Render(false):
c:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,39) : error CS1002: ; expectedc:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,41) : error CS1002: ; expectedc:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,41) : error CS1525: Invalid expression term ':'c:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,42) : error CS1002: ; expectedc:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,44) : error CS1002: ; expectedc:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,44) : error CS1525: Invalid expression term ':'c:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,45) : error CS1002: ; expectedc:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,48) : error CS1002: ; expected
if _DateVar variable isn't changed (skip of report.Dictionary.Variables["_DateVar"].ValueObject = new DateTime(2010, 10, 1);) - report is rendered without error.
if _DateVar variable has following parameters
Name: _DateVar
Type: datetime
Default Value: 01/24/20011 ...
Read Only: false
Function: false
Request from User: false
report is also rendered without error in my app.
i have added a new variable with following parameters
Name: _DateVar
Type: datetime
Default Value: Today (selected from a list of system variables)
Read Only: false
Function: true
Request from User: false
This variable is used in filter of the databand:
Field Is: Expression
Membership.ExpirationDate > _DateVal
Report preview in Designer tool is ok, but i have a problem with report's execution in my app:
....
report.Load(......);
DataSet ds = new DataSet();
ds.ReadXmlSchema("SE.xsd");
ds.ReadXml("SE.xml");
report.Dictionary.DataStore.Clear();
report.Dictionary.Databases.Clear();
report.RegData("SE", ds);
report.Dictionary.Synchronize();
if (report.Dictionary.Variables.Contains("_DateVar"))
{
report.Dictionary.Variables["_DateVar"].ValueObject = new DateTime(2010, 10, 1);
}
report.Render(false);
report.ExportDocument(StiExportFormat.Pdf,"SE.pdf");
........
error is on line report.Render(false):
c:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,39) : error CS1002: ; expectedc:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,41) : error CS1002: ; expectedc:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,41) : error CS1525: Invalid expression term ':'c:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,42) : error CS1002: ; expectedc:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,44) : error CS1002: ; expectedc:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,44) : error CS1525: Invalid expression term ':'c:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,45) : error CS1002: ; expectedc:\Users\luczan\AppData\Local\Temp\epx4zlip.0.cs(149,48) : error CS1002: ; expected
if _DateVar variable isn't changed (skip of report.Dictionary.Variables["_DateVar"].ValueObject = new DateTime(2010, 10, 1);) - report is rendered without error.
if _DateVar variable has following parameters
Name: _DateVar
Type: datetime
Default Value: 01/24/20011 ...
Read Only: false
Function: false
Request from User: false
report is also rendered without error in my app.
XML Data and report with parameters
Hello,
In this case (Function: true) you can use the following code:
Thank you.
In this case (Function: true) you can use the following code:
Code: Select all
...
if (report.Dictionary.Variables.Contains("xxx"))
{
report.Dictionary.Variables["xxx"].ValueObject = "new DateTime(2010, 10, 1);";
}
...
XML Data and report with parameters
great, problem solved
thanks
thanks
XML Data and report with parameters
Have a nice day!