Telerik Forums
Reporting Forum
7 answers
212 views
I ran into a technical roadblock and wonder if anyone has a solution or suggestions.  Scenario and background as follows:

1.  I'm using Telerik Reporting to generate a number of reports in a web site (built with ASP .Net 2.0) .  I'm not using the report viewer, rather the report is streamed to the user as PDF files from which they can print or save as appropriate.  This is accomplished via the following code sequence (pretty standard technique I believe):

Response.Clear()
Response.ContentType = strMimeType
Response.Cache.SetCacheability(HttpCacheability.Private)
Response.Expires = -1
Response.Buffer =

False
Response.AddHeader("content-disposition", _
"attachment; filename=""" & strFileName & """")
Response.OutputStream.Write(reportBytes, 0, reportBytes.Length)
Response.End()



2.  From the report web page, the user clicks the Generate button to generate a selected report.  As soon as this button is clicked, the mouse cursor turns to an hourglass.  This is accomplished via a simple client-side javascript function that sets the cursor style to hourglass in conjunction with setting the "onClick" attribute for the button Generate, (in page_load event), as follows:

function hourglass()
{document.body.style.cursor =
"wait";}


' This is set in the page_load event of the aspx.vb file
btnGenerate.Attributes("onclick") = "javascript: hourglass();"


3.  In real time, the user clicks the Generate button, the mouse cursor turns to hourglass (by virtue of the client-side action mentioned above) while the report is being generated.  After a period of time, the PDF download dialog appears on top of the report web page.  The user opens the PDF file, prints it and then closes the PDF file.  Everthing works fine up to this point.

4.  Once the PDF file is closed, the report web page is, of course, still there.  The problem is the mouse cursor is still showing the hourglass.

5.  The problem appears to lie in the fact that the cursor is never reset to the default style.  And it appears that there isn't an opportunity to reset the cursor because there isn't a postback to the report web page AFTER the user has printed the PDF file and closes the PDF application. 

I've tried adding client-side javascript to reset the cursor at window.onload.  It doesn't do it because the report web page is NOT reloaded after the PDF file is generated.

I hope this makes sense.  I'd appreciate if anyone has any suggestions.

Thanks.

Barry


 

Steve
Telerik team
 answered on 19 Nov 2010
1 answer
60 views
Is it doable to get an empty data template somewhere in a report section where we can put in something easily when the DS returns no results?...I mean just to make it a bit easier instead of having to always implement some sort of conditional formatting or handle the databound events?
Steve
Telerik team
 answered on 19 Nov 2010
3 answers
122 views
Hi,

I am facing a problem while generating a report.

when i click on "generate report" button, report is generated as i wanted. but i want to show the LoadingPanelImage while Report is being generated. I have put reportviewr and other controls in ajax panel.

Problem is When i click on the "Generate Report" button it shows the loading panel for a while and then page is being post back.
Help me to get out of this.

Code:
 protected void btnReport_Click(object sender, EventArgs e)
 {
            DetailReport rpt = new DetailReport();
            DateTime dtFromDate = Convert.ToDateTime(txtFromDate.SelectedDate);
            DateTime dtToDate = Convert.ToDateTime(txtToDate.SelectedDate).AddHours(23.00).AddMinutes(59.00).AddSeconds(59);
            rpt.ReportParameters["Interview"].Value = Convert.ToInt32(ddlInterview.SelectedItem.Value);
            rpt.ReportParameters["Facility"].Value = Convert.ToInt32(ddlFacility.SelectedItem.Value);
            rpt.ReportParameters["FromDate"].Value = dtFromDate;
            rpt.ReportParameters["ToDate"].Value = dtToDate;
            if (txtCautionArea.Text != "")
            {
                rpt.ReportParameters["CautionArea"].Value = Convert.ToInt32(txtCautionArea.Text);
            }
            else
            {
                rpt.ReportParameters["CautionArea"].Value = 0;
            }

            //ReportViewer1.RefreshReport();
            ReportViewer1.Report = rpt;
        }

aspx:


<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnReport">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ReportViewer1" LoadingPanelID="RadAjaxLoadingPanel1"
                        UpdatePanelHeight="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        
    </telerik:RadAjaxManager>
Steve
Telerik team
 answered on 19 Nov 2010
6 answers
739 views
I'm trying to dynamically bind a picturebox to images on my web site using a url.  The image file which may or may not be there is dependent on a report field.  I'm added an ItemDataBound event to the class with the following code:

private void pictureBox1_ItemDataBound(object sender, EventArgs e)
{
     this.pictureBox1.Value = "http://mywebsite.com/images/" + "=Fields.pic_name" + ".png";
}

But it's not working and I'm getting  "The path is not of a legal form" error.  Even when I try directly entering a url of an image I know is on the web site, I'm still getting the same error.



hashiny
Top achievements
Rank 1
 answered on 19 Nov 2010
0 answers
144 views
Hello All,

I have a web form (PaymentControlHistory.aspx) with two controls (RadStartDate, and RadEndDate) both rad calendar controls. my report has a master report and several subreports that need to access those two controls to rewrite their respective SQL statements. The controls are to filter fields that cannot be used on the report due to grouping.

What is the best way to get the SelectedValue from thes two controls on the parent form that contains the report viewer? I've looked at the different videos and couldn't figure it out. Is it as easy as Parent.RadStartDate.SelectedValue?

Regards,

David
David
Top achievements
Rank 1
 asked on 18 Nov 2010
3 answers
336 views
Telerik report viewer on my page is displaying weirdly exactly like shown in this article:-

 http://www.telerik.com/support/kb/reporting/report-viewers/the-styles-of-the-web-report-viewer-s-toolbar-are-messed-up.aspx

When I embed report viewer in my page that uses no master page, the report viewer displays alright but when I use master page..it's displaying double buttons on toolbar like the article above. How do I fix this ?

The solution in the article above is that I need to add preCondition attribute but mine is " IIS5.1 "  and when I add that attribute..it says "preCondition attribute not declared"

Also, how do I implement "Preview button" on the report viewer toolbar like this demo :-

http://demos.telerik.com/reporting/sales-dashboard/demo.aspx
Steve
Telerik team
 answered on 18 Nov 2010
1 answer
78 views
Two Things I'd like in PITS if possible....

1) More Built-In Styles for tables\etc, or improve the existing ones so they don't look like a 1995 website.
2) In the Parameters boxes can you add like a Nullable checkbox to the right so we don't have to keep typing =IsNull
Steve
Telerik team
 answered on 18 Nov 2010
3 answers
140 views
I just upgraded to Reporting v.4.1.10.291 and now I cannot reference the Telerik.Reporting.Report namespace. Any idea as to why?


Thanks
Steve
Telerik team
 answered on 18 Nov 2010
1 answer
76 views
Hi,

Very simple question - I guess. How can I have a grouping like shown in the attachment with the line above and below the result? It's quite straight forward in crystal reports. I am sure I am missing very important concept.

Many thanks.
MG

Peter
Telerik team
 answered on 18 Nov 2010
1 answer
1.2K+ views
I'm looking at an alternative to Crystal Reports and I'm down to two choices:  Telerik or DevExpress.

To be honest, I really like Telerik on the whole a lot more, especially with the WinForms controls but if I can't get this simple task by today I can't look past it.  I have an application that reads data from mixed xml sources, processes the data in a list of classes and prints out a report.  Nothing fancy, no drill-downs, just as if they were datarows.

So basically the class would look like:

public class MyDataClass
{
 public int MyInt { get; set; }
 public string MyString { get; set; }
 public DateTime MyDate { get; set; }
 
 public MyDataClass()
 {
 }
}

As it's computing, it puts it into a List<MyDataClass> that gets stored until it's ready.  The data source wizard detects it once I put in [DataObject] attribute on the class.  From here, both Crystal Reports and DevExpress can easily be hooked up to the list of objects easily.  Once it knows the type definition, I can set the datasource property to the list and it works.

But I cannot for the life of me find a simple or straightforward way to do this in Telerik.  Since there are 12 types of classes I'm processing, do I need to create 12 generic collections that each implement IEnumerable?  And then where do I hook in my actual instance of data?  Am I misunderstanding the terminology that Telerik Reporting is using?  Datasource is usually literally the source of the data.  But in the documentation, it appears to be used as the data definition.

This is simple stuff, but I haven't found any simple answer.  The demo page just shows a video, but doesn't show the code behind (unless I missed it).  Sure, the demo is great for showing what it can do, but it's incomplete in telling us how.  I'm running out of time before I need to give a verdict because it's going to be used to replace a lot of tools we currently use.
Peter
Telerik team
 answered on 18 Nov 2010
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?