| Calc ooReport for .Net Articles |
|
| Creating reports with parameters.
|
Following the tradition, let’s create a project that will display the phrase "Hello world!" in the report.
To achieve this do the following:
- Create a new project, and then add to this project a link to the dswsoft.ooReport library assembly in References
- Add a using directive with dswsoft.ooReport namespace.
- Announce the Report-type variable _report, and then create an object.
- Launch OpenOffice.org Calc and create a template. In B2 cell of the template “Sheet1” sheet specify the parameter, which will be filled in during the report creation. Our library allows the same parameter to be reused. In order to see how it works, specify the same parameter in C3 cell of the“Sheet2” sheet. These cells may have different formatting.
- Onto the main application form place two elements: “TextBox” and “Button”.
- Enter the following code to the event handler Click:
- Compile and launch a newly created application. Into the TextBox field enter "Hello World!" text, then press Report button.
- The report will be generated in OpenOffice.org Calc. On the corresponding pages you will see the phrase "Hello World!".
Article by: Leonid Pavlenko, Sergei Moutsynov
Translated by: Helen Shkondina
|