1. How to save/load a report?
2. How to load DataSet XSD schema?
3. How to render a report?
4. How to access to the variables?
5. How to attach data to a report?
6. How to run a report designer?
7. How to save/load a rendered report?
8. How to print a report immediately without preview?

1. How to save/load a report?

To save a report:
StiReport report = new StiReport();
report.Save("report.mrt");
To load a report:
StiReport report = new StiReport();
report.Load("report.mrt");

2. How to load DataSet XSD schema?

To load DataSet XSD schema you may use ImportXMLSchema method:
StiReport report = new StiReport();
DataSet dataSet = new DataSet("Test");
dataSet.ReadXmlSchema("dataset.xsd");
report.Dictionary.ImportXMLSchema(dataSet);

3. How to render a report?

To render a report and to show a rendered report in the preview window:
StiReport report = new StiReport();
report.Load("report.mrt");
report.Show();

4. How to access to the variables?

To access to the variables, you may use this code:
StiReport report = new StiReport();
report.Load("Variables.mrt");
report.Compile();

// Set Variable
report["VariableName"] = "Value";

// Get Variable
object value = report["VariableName"];

5. How to attach data to a report?

It is necessary to register data in the Data Store to attach them to a report. You can do it this way:
DataSet dataSet1 = new DataSet();
dataSet1.ReadXmlSchema("Demo.xsd");
dataSet1.ReadXml("Demo.xml");

StiReport report = new StiReport();
report.RegData(dataSet1);

6. How to run a report designer?

Do it like this:
StiReport report = new StiReport();
report.Design();

7. How to save/load a rendered report?

To save a rendered report:
// Rendering report
StiReport report = new StiReport();
report.Load("report.mrt");
report.Render();

// Saving report
report.SaveDocument("document.mdc");
To load previously saved rendered report:
StiReport report = new StiReport();
report.LoadDocument("document.mdc");

8. How to print a report immediately without preview?

For a start load of a report:
StiReport report = new StiReport();
report.LoadDocument("document.mdc");
And now print a report:
report.Print();
By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.