in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Retrieve Report Definition XML Element

Last post 01-22-2008 9:41 AM by C1_AndrewM. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-10-2008 2:19 PM

    • MMyers
    • Not Ranked
    • Joined on 09-19-2007
    • Posts 5

    Retrieve Report Definition XML Element

    Is there a way in WebReports to get a value from the XML in the report definition file?

    i can do txtUserName.value = Report.DataSource.ConnectionString and that works fine to show me the report's connection string.

     In my ASP.Net code, i append an element to the //Reports/Report/DataSource node called "ReportUserName" to the WebReports definition file, which works, and then display the report as a PDF document in the browser.  yes, my appended node is in the rendered XML defintion file and it is where i expect it to be.

    i need to be able to get the value of my appended element to show in the textbox on my report.

     i used the following code in the Footer section's OnPrint Event:

    txtUserName.value = Reports.DataSource.ReportUserName

  • 01-21-2008 8:09 AM In reply to

    Re: Retrieve Report Definition XML Element

    Instead of modifying and adding an XMLElement, you may use a ReportField and set its visibility to false. You may then access this ReportField by Report.Section("SectionName").FieldName.
     
    Also with every report definition file there is a property called: ReportInfo which consists of following properties:
    1. Author
    2. Creator
    3. KeyWords
    4. Subject and
    5. Title.
     
    You may use this object to store the information.
     
    I hope it helps.
     
    Regards,
    Andrew
    <MMyers> wrote in message news:201011@10.0.1.98...

    Is there a way in WebReports to get a value from the XML in the report definition file?

    i can do txtUserName.value = Report.DataSource.ConnectionString and that works fine to show me the report's connection string.

     In my ASP.Net code, i append an element to the //Reports/Report/DataSource node called "ReportUserName" to the WebReports definition file, which works, and then display the report as a PDF document in the browser.  yes, my appended node is in the rendered XML defintion file and it is where i expect it to be.

    i need to be able to get the value of my appended element to show in the textbox on my report.

     i used the following code in the Footer section's OnPrint Event:

    txtUserName.value = Reports.DataSource.ReportUserName



    http://helpcentral.componentone.com/cs/forums/p/74009/201011.aspx#201011

  • 01-21-2008 4:26 PM In reply to

    • MMyers
    • Not Ranked
    • Joined on 09-19-2007
    • Posts 5

    Re: Retrieve Report Definition XML Element

    thanks for the feedback on my issue. 

     i just ended up programmatically using the Report.Tag property to get my value into the report's xml definition file so that i can display the value.

     to clarify the situation, i have a front-end web app that collects report criteria and modifies the C1 report XML file for the correct connection string and I place the criteria into the modified report sql statement dynamically before the report is run and rendered as pdf in a browser window.

     on my report layout, i needed to include the name of the person who ran it dynamically from the ASP.Net session, and it seemed that i needed an easy way to put that into my report's XML definition so that i could display it.

     what i did was created a report.tag element in the report's xml source and then refered to report.tag to display it.

     i don't think i could use a report field as you suggested because i needed to have my custom username added to the report xml definition BEFORE the report ran, or am i missing something in setting up a report field? 

  • 01-22-2008 9:41 AM In reply to

    Re: Retrieve Report Definition XML Element

    If you want to customize the ReportDefinition file, you may insert the new XMLElement called <Author></Author> or <Creator></Creator> or <Keywords></Keywords> or <Subject></Subject> or <Title></Title>
     
    These elements can be placed under
     
    <?xml version="1.0"?>
    <Reports>
      <!--Report *** Report Name ***-->
      <Report version="2.5.20073.258">
        <Name>Report Name</Name>
        <ReportInfo>
     
    If you are doing this, you don't need to load the report in the C1WebReport control. You may directly play with the .xml file.
     
    Regards,
    Andrew
     
    <MMyers> wrote in message news:201240@10.0.1.98...

    thanks for the feedback on my issue. 

     i just ended up programmatically using the Report.Tag property to get my value into the report's xml definition file so that i can display the value.

     to clarify the situation, i have a front-end web app that collects report criteria and modifies the C1 report XML file for the correct connection string and I place the criteria into the modified report sql statement dynamically before the report is run and rendered as pdf in a browser window.

     on my report layout, i needed to include the name of the person who ran it dynamically from the ASP.Net session, and it seemed that i needed an easy way to put that into my report's XML definition so that i could display it.

     what i did was created a report.tag element in the report's xml source and then refered to report.tag to display it.

     i don't think i could use a report field as you suggested because i needed to have my custom username added to the report xml definition BEFORE the report ran, or am i missing something in setting up a report field? 



    http://helpcentral.componentone.com/cs/forums/p/74009/201240.aspx#201240

Page 1 of 1 (4 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.