Telerik Forums
Reporting Forum
0 answers
108 views
Hiya,

I been running through the Telerik RadGrid forum several times trying to find a scenario similar to no avail, therefore I'm hoping to seek some wisdom here. In my situation I'm using Telerik ASP.NET AJAX Q2 and Telerik Reporting Q3. I've created a test report class (Test.cs) which I intended to be used as report template for my RadGrid. The problem arises when I've finshed my Grid and my Reporting Class. I've yet to find a way to make RadGrid to pass over the data into the Reporting Class which should appear as PDF embedded in ReportViewer inside browser.

Basically I would like the grid to send the primary key value of the selected row to the reporting class library when a user clicked the ClientGridSelectColumn and clicked a "Print Selected" asp:LinkButton. I've gon through a couple of forum posts here such as here:
http://www.telerik.com/community/forums/reporting/telerik-reporting/radgrid-telerikreporting-interaction.aspx
and
http://www.telerik.com/help/aspnet-ajax/grid-retrieve-primary-key-field-values-for-items.html  they did solve part of the problem however due to my lack of in depth understanding of telerik products the solution provided were not working as expected.

I hope someone could shed a little light to accomplish this task. Thanks in advance.

Bernard
Top achievements
Rank 2
 asked on 30 Nov 2012
1 answer
191 views
Im trying to open print dialog box on client and server side without using Reportviewer..It works for IE,Chrome and Safari but it doesn't work in Firefox..

Thanks..

Here is my test code:
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
    <telerik:RadCodeBlock runat="server">
        <script type="text/javascript">
            ReportViewer.prototype.PrintReport = function()
            {
                this.PrintAs("Default");
            }
            function MyPrint()
            {
                <%=ReportViewer1.ClientID %>.PrintReport();
            }    
        </script>
    </telerik:RadCodeBlock>
 
    <script type="text/javascript">
        ReportViewer.OnReportLoadedOld = ReportViewer.OnReportLoaded;
         
        ReportViewer.prototype.OnReportLoaded = function () {
            this.OnReportLoadedOld();
            var printButton = document.getElementById("PrintButton");
            printButton.disabled = false;
        }
   
    </script>
</head>
<body>
    <form id="form1" runat="server">
 
        <asp:ScriptManager runat="server" />
 
        <div>
            <asp:Button ID="Button1" runat="server" Text="Print" OnClick="Button1_Click" Style="width: 41px" />
            <asp:Button ID="PrintButton" runat="server" Text="Print Dialog Server" OnClick="PrintButton_Click" />
            <asp:Button ID="PrintClient" runat="server" Text="Print Client" OnClientClick="MyPrint(); return false;" />
            <telerik:ReportViewer ID="ReportViewer1" runat="server" Width="100%" Height="800px" Style="display:none"></telerik:ReportViewer>
        </div>
 
    </form>
</body>
</html>

End the server side code:
public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
            instanceReportSource.ReportDocument = new Report1();
            this.ReportViewer1.ReportSource = instanceReportSource;
        }
 
        protected void Button1_Click(object sender, EventArgs e)
        {
            ExportToPDF(new Report1());
        }
        void ExportToPDF(Telerik.Reporting.Report reportToExport)
        {
            ReportProcessor reportProcessor = new ReportProcessor();
            Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
            instanceReportSource.ReportDocument = reportToExport;
            Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, null);
 
            string fileName = result.DocumentName + "." + result.Extension;
 
            Response.Clear();
            Response.ContentType = result.MimeType;
            Response.Cache.SetCacheability(HttpCacheability.Private);
            Response.Expires = -1;
            Response.Buffer = true;
 
            Response.AddHeader("Content-Disposition",
                               string.Format("{0};FileName=\"{1}\"",
                                             "attachment",
                                             fileName));
 
            Response.BinaryWrite(result.DocumentBytes);
            Response.End();
        }
 
        protected void PrintButton_Click(object sender, EventArgs e)
        {
            string printScript = string.Format("{0}.PrintReport();", this.ReportViewer1.ClientID);
            this.ClientScript.RegisterStartupScript(this.GetType(), "ReportPrint", printScript, true);
        }
    }
Veysel
Top achievements
Rank 1
 answered on 29 Nov 2012
2 answers
228 views
Hi!

I have a class library with my reports in it. I have another project where my entitymodel is in. In my reports project I've added a reference to the project where my entitymodel is in. I've also added the connection string to the reports project and rebuild the project. In my project I try to use an entitydatasource. I can select the connectionstring from the web.config, but if I click next, the Object Context is empty and I can't select anything.

Why is this happening and how can I fix it?

Luki
Top achievements
Rank 1
 answered on 29 Nov 2012
1 answer
263 views
Hi,

I have generated a dynamic telerik report, in that there are checkboxes and they should be checkable after exporting the report to PDF or word file.

one more requirement is i want a datepicker to be part of the report page as well as the generated pdf or word files.

need some help on how to achieve this

thanks in advance

- NeelaKrishna
Steve
Telerik team
 answered on 29 Nov 2012
2 answers
522 views
Hi. I'm currently using ActiveReports and considering switching to Telerik Reporting. One of the issues I am having is the ability to create an Excel report with multiple pages (sheets). The number of pages is unknown until the dataset is created. ActiveReports handles this, but with a restriction, when you export to XLS you cannot name the workbook sheets. Would Telerik Reporting allow me to do everything I can do already plus what I am missing?

1) Multiple reports combined inside a single export (workbook), XLS only
2) Each report has its own unique name and should be used as the sheet name

Thanks.
Brendon
Top achievements
Rank 1
 answered on 29 Nov 2012
6 answers
338 views
I am having trouble using the navigation with the Telerik.ReportViewer.WPF Q3 2011.  I am using the MVVM design pattern and passing a reference of the reportviewer to the viewmodel.  In response to a click event a customer dataobject is constructed and populated and feed as the data source to a new distribution report.  The new distribution report is then set as the value for the reportviewer.  However as different versions of the report are ran they are not viewable through the navigation buttons.  How can I accomplish this?

 

var products = Products.Where(x => x.IsSelected);

Custom business object

DistributionCompilation distribution = new DistributionCompilation();

Populating the business object

distribution.BuildSingleBrandDistributionRport(products, SelectedStart, SelectedEnd, MinBottles, NoBuyPeriod, SelectedBrand.Name);

Setting it as the source for the report

NewDistributions distribution_report = new NewDistributions();

distribution_report.DataSource = distribution.ShowReport();

_View.Report = distribution_report;


Malcolm
Top achievements
Rank 1
 answered on 28 Nov 2012
3 answers
913 views

Hello everyone. I have a situation where I have created a master summary report with 2 detail sub reports in it. One of my 2 sub reports refuses to show any data. It is configured the same as the 2nd sub report with its parameters properly being passed along but I get bupkis.

I can run the sub report in question by its self and it will display data beautifully but not when I add it as a sub report to my master report.

I found some code while searching the forum to display a custom message when my sub report has no data and using that I have verified that the sub report is just not getting any data back when run.

Any ideas here to help me get over this hump?

Malcolm
Top achievements
Rank 1
 answered on 28 Nov 2012
12 answers
274 views
I'm trying to add a report to my application called: Availability.cs but I got the message:

The vstemplate file references the wizard class 'Telerik.Reporting.Design.Wizard.AddNewReportWizard', which does not exist in the assembly 'Telerik.Reporting.Design', Version=6.0.12.215, Culture=neutral, PublickeyToken=a9d783dfcc261be'

Ricardo
Top achievements
Rank 2
 answered on 28 Nov 2012
3 answers
144 views
Hello, I have an MVC 3 web project and have created a reports library.  I am new to Telerik reporting but have done previous reporting using SSRS.  For each of my individual report "MyReport.cs" file(s), I have setup some parameters using the wizard.  When a user selects 5 to 6 different parameters from various drop down lists, textboxes, etc, on a report, I want to give the user the ability to save these parameters to the database.  I need to add a label stating "Save this parameterized report as:" with a textbox after it for the user to enter some text, and a button to submit these to the database.  I then want to open this report at another time with the parameters already filled in.  Are there any examples that show how to do this, how to access the code behind, etc?  Thanks very much...
Steve
Telerik team
 answered on 28 Nov 2012
6 answers
168 views
Hi, I have a report telerik, in a rad window, then when I want see the report in my page, get de error Sesion expired(attachment file), I read yours KB articules, and I don't what is my case o wich can be the solution ..
In localhost I haven't problems, only when Is the request in my page. Can be a problem in IIS?
Steve
Telerik team
 answered on 28 Nov 2012
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?