Moving a report from designer to app?

13 posts, 1 answers
  1. Ed Lance
    Ed Lance avatar
    61 posts
    Member since:
    Jun 2012

    Posted 11 Oct 2012 Link to this post

    I am considering giving some users the stand alone designer so they can make some of their own reports.  I know one question that will be asked, "if we make a report we like, how do we get it in our web site?"  In other words, they prototype reports and play around with them.  When they get one they like a lot, they would want me to put it in the VS project so they can view it in the main web site.

    So, the report designer saves to a .trdx file.  But the project files are code (vb or cs).  So how to do the import?  I would have expected an "Import trdx file" in the VS Telerik Reporting menu.  Am I missing something? 

    Thanks.
  2. Answer
    Peter
    Admin
    Peter avatar
    1611 posts

    Posted 12 Oct 2012 Link to this post

    Hello Ed,

    The trdx report definitions don't have to be included in the project. You can only copy them on the server and in code you can iterate through the files in the folder, display list of available reports in a drop down and show the selected report in report viewer with UriReportSource.

    Kind regards,
    Peter
    the Telerik team

    HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  3. DevCraft banner
  4. Ed Lance
    Ed Lance avatar
    61 posts
    Member since:
    Jun 2012

    Posted 12 Oct 2012 Link to this post

    Peter,
    Thanks, I will give that a try, i wasn't familiar with the UriReportSource. 

    Still think it would be a really good idea to have something that can covert a .trdx into a report class file.
  5. Sean Drun
    Sean Drun avatar
    6 posts
    Member since:
    Jun 2012

    Posted 18 Oct 2012 Link to this post

    Hello,
    Any follow up about this issue.
    I load the latest Q3 2012, play with standalone designer, save a report layout to trdx file, load in into web ReportView by
    Telerik.Reporting.UriReportSource urs = new Telerik.Reporting.UriReportSource();
    urs.Uri = trdxPathNFileName;
    ReportView1.ReportSource = urs;
    The web page shows and hang.

    We are evaluating telerik reporting.
    Please give a working example in web project.

    Thanks,
    Sean Drun
  6. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 19 Oct 2012 Link to this post

    Hi Sean,

    Check out the attached sample and if you experience any further difficulties please elaborate further on your scenarios and any exceptions.

    Greetings,
    Peter
    the Telerik team

    HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  7. Sean Drun
    Sean Drun avatar
    6 posts
    Member since:
    Jun 2012

    Posted 19 Oct 2012 Link to this post

    Hi Peter,
    Thank you for the sample project file.
    I test run it and it does load and show trdx file on web page.
    But the same code, trdx just won't show on my web page.
    After try and error a while, I think it is the style problem of ReportViewer.
    We are using Telerik Ajax radcontrol to develop our web app.
    When ReportViewer declared in RadControl web page, it just won't show any report content.
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
    <%@ Register TagPrefix="telerik" Assembly="Telerik.ReportViewer.WebForms" Namespace="Telerik.ReportViewer.WebForms" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
        <style type="text/css">        
            html#html, body#body, form#form1, div#content, center#center
            {  
                border: 0px solid black;
                padding: 0px;
                margin: 0px;
                height: 100%;
            }
        </style>
        <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <div id="content"><center id="center">
            <telerik:ReportViewer ID="ReportViewer1" runat="server" width="99%" height="99%"></telerik:ReportViewer>
            </center>
        </div>
        </form>
    </body>
    </html>
    If I change width, height of the ReportView1 to fix px, then it shows report context.
    What's is the correct style or solution to make ReportViewer take up whole web page space?
    I have tried the suggestion on your online help-FAQ, it does not work either.

    Thanks,
    Sean Drun
  8. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 24 Oct 2012 Link to this post

    Hello Sean,

    In order to have the Web ReportViewer display in 100% height, you need to specify height to the whole DOM tree. Check out the updated style:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
     
    <%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=6.2.12.1017, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
    <head id="Head1" runat="server">
        <title></title>
        <style type="text/css">       
            html, body, form#form1, div#content, center#center
            
                border: 0px solid black;
                padding: 0px;
                margin: 0px;
                height: 100%;
            }
        </style>
        <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //script
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
        </telerik:RadAjaxManager>
        <div id="content">
            <center id="center">
                <telerik:ReportViewer ID="ReportViewer1" runat="server" width="99%" height="99%"/>
            </center>
        </div>
        </form>
    </body>
    </html>
    Regards,
    Peter
    the Telerik team

    HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  9. Syed
    Syed avatar
    8 posts
    Member since:
    Dec 2012

    Posted 01 May 2013 Link to this post

    Hi
    I have been trying out the sample WebTRDXDemo - I am bit unclear about the Path of the report saved,

    e.g. if I move the 'Barcodes Report.trdx' to a 'Reports' Folder and change the codebehind as 

    reportSource.Uri = "Reports/Barcodes Report.trdx";

    it doesn't work, it is still looking for the report at the original place. 

    where is the 'base path' configured?

    Thanks
    Hamid
  10. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 02 May 2013 Link to this post

    Hi,

    Check out the following code snippet:

    var reportSource = new UriReportSource();
    reportSource.Uri = ".\\Reports\\Dashboard.trdx";
    this.ReportViewer1.ReportSource = reportSource;
    Additionally the file properties should be Build action set to Content and Copy to output directory set to Copy if newer.

    Regards,
    Peter
    the Telerik team

    Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

  11. Syed
    Syed avatar
    8 posts
    Member since:
    Dec 2012

    Posted 02 May 2013 Link to this post

    Thank you very much - working well now

    Any samples of Reports with parameters  and subreports please,

    How to use QueryString as parameter in Report SqlDataSource ?

    How to link ParentReport and Subreport - like on common fields please.

    Thanks
    Hamid
  12. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 06 May 2013 Link to this post

    Hi Hamid,

    How to set report parameter value is elaborated in the UriReportSource Class article and how to relate it to your SqlDataSource is elaborated in the SqlDataSource Wizard and Using Parameters with the SqlDataSource component help articles.

    About sample subreport check out the Invoice demo that came with your Telerik Reporting installation.

    Kind regards,
    Peter
    the Telerik team

    Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

  13. Shekhar
    Shekhar avatar
    1 posts
    Member since:
    May 2013

    Posted 28 May 2013 Link to this post

    I have created a report in report designer tool. Now, i want to open this report in WPF application is it possible. Will you please provide some sample code to view report .trdx file in wpf application?
  14. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 31 May 2013 Link to this post

    Hi Shekhar,

    You can use an UriReportSource and display your XML report definition in the WPF ReportViewer as illustrated in the code snippet here.

    In future please avoid double posting or posting question not related to the main topic discussed in the thread. Thus there is more likely other community members to notice your post and help you.

    Regards,
    Stef
    Telerik

    Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Back to Top
DevCraft banner