Telerik Forums
Reporting Forum
2 answers
81 views
I recently upgraded to Telerik Reporting Q1 2010 and to VS2010.  I have a reporting project where most of my charts have converted up and run fine.  However I have one page where I render 4 charts on one page, and I'm getting 4 jscript errors:

Object required  Telerik.ReportViewer.axd?optype=Resource&version=4.0.10.423&name=Resources.ReportViewer.js, line 430 character 5

from this function:
ReportViewer.prototype.get_Height = function()
{
    var reportTable = document.getElementById(this.reportTableId);
    var lastRow = reportTable.rows[reportTable.rows.length - 1];
    var oldDisplay = lastRow.style.display;
    lastRow.style.display = "none";
  
    var viewer = document.getElementById(this.clientID);
    var clientHeight = viewer.clientHeight;
    lastRow.style.display = oldDisplay;
    return clientHeight;
}

The failure is caused by var viewer being null.
Any ideas?
Dan
Peter
Telerik team
 answered on 03 Aug 2010
4 answers
351 views
I have a function for exporting reports directly to pdf that works great but I want to be able to redirect the user once the report is generated and can't seem to make that happen. I either can redirect the user or print the report and the user stays on the page. Here is the code I use for the export, taken from a blog on this site. Works great.

Public Function ExportToPDF(ByVal reportToExport As Telerik.Reporting.Report) As Telerik.Reporting.Report
       Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor()
       Dim result As RenderingResult = reportProcessor.RenderReport("PDF", reportToExport, Nothing)
       Dim fileName As String = result.DocumentName + ".pdf"
       HttpContext.Current.Response.Clear()
       HttpContext.Current.Response.ContentType = result.MimeType
       HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.Private)
       HttpContext.Current.Response.Expires = -1
       HttpContext.Current.Response.Buffer = True
       'Uncommenting the following line will prompt user to Open Save or Cancel. Otherwise report opens in new window
       HttpContext.Current.Response.AddHeader("Content-Disposition", String.Format("{0};FileName=""{1}""", "attachment", fileName))
       HttpContext.Current.Response.BinaryWrite(result.DocumentBytes)
       HttpContext.Current.Response.End()
   End Function
I was told to remove the last line that ends the request and add this:
HttpContext.Current.Response.Redirect("../WorkOrders/OpenWorkOrdersSummary.aspx", True)
But that didn't work, it only redirected me to the new page but no report got generated. Here is the code I use to generate the report:
If ChkPrint.Checked = True Then
           Dim tF As New TelerikFunctions
           Dim rv = New FacilitiesReportsLibrary.WorkOrder
           rv.setWorkOrderID = Session("WorkOrderID")
           tF.ExportToPDF(rv)
       Else
           Response.Redirect("../WorkOrders/OpenWorkOrdersSummary.aspx")
       End If
Any help would be appreciated.
AkAlan
Top achievements
Rank 2
 answered on 31 Jul 2010
4 answers
171 views
I have recently started using the Telerik reporting to make a multi-sourced complex report.  I have figured out how to fulfill most of my requirements, but I have two issues currently with the Telerik reporting that I have not been able to resolve.

Issue #1:

All of the paging/printing/exporting options at the top are doubled up.  (A colored icon and a greyed icon)  This happens regardless of the Skin that I tried.  Since the demos don't have a source option like the other Telerik controls, I have not been able to view how it was done in your demos to make the header look normal.  I have attached a small screenshot below.

Report definition looks like this:
<telerik:ReportViewer ID="ReportViewer1" Width="721px" Height="1100px" runat="server" 
    Report="NAVPass.Reports.AMRForm, NAVPass.Reports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" 
    ProgressText="Generating AMR document..." Skin="Original">
</telerik:ReportViewer>

Issue #2:

I have checkboxes attached to a data source.  They load correctly, but no matter what parameters I try in the properties, they always appear left justified, and I am trying to center them within the column.  I have tried the following properties:

TextAlign : Center
Padding->Left : [some value]
CheckAlign : MiddleCenter
Location->X : [some value]

The two tables have data sources that are loaded in a fairly straightforward way:
// Detail section
ICollection<Inspection> inspectList = insRepo.GetInspectionsForAMR(ReportParameters["AMRID"].Value.ToString());
tableInspections.DataSource = inspectList;
ICollection<Equipment> equipList = equipRepo.GetEquipmentForAMR(ReportParameters["AMRID"].Value.ToString());
tableEquipment.DataSource = equipList;

From the designer.cs file:
// 
// cbRequired
// 
this.cbRequired.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.cbRequired.CheckedImage = ((object)(resources.GetObject("cbRequired.CheckedImage")));
this.cbRequired.IndeterminateImage = ((object)(resources.GetObject("cbRequired.IndeterminateImage")));
this.cbRequired.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.30000001192092896, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch));
this.cbRequired.Name = "cbRequired";
this.cbRequired.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(0.59999996423721313, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.24999998509883881, Telerik.Reporting.Drawing.UnitType.Inch));
this.cbRequired.Style.BorderStyle.Top = Telerik.Reporting.Drawing.BorderType.Solid;
this.cbRequired.Style.Padding.Left = new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch);
this.cbRequired.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
this.cbRequired.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
this.cbRequired.StyleName = "";
this.cbRequired.Text = "     ";
this.cbRequired.UncheckedImage = ((object)(resources.GetObject("cbRequired.UncheckedImage")));
this.cbRequired.Value = "=Fields.Required";

Please let me know what I am doing wrong.  Thanks.
Peter
Telerik team
 answered on 30 Jul 2010
2 answers
104 views
I have a master report, the ctor of which accepts 4-arguments. This report contains 1-subreport. In the InitializeComponents() method of the master report, an instance of the sub-report is created, which fires the ctor of the sub-report. My problem is that I need to pass along some of the arguments sent to the master report ctor to the sub-report ctor. Ideas anyone? A sample of how to accomplish this would be most useful.

Thanks!
Patrick
Top achievements
Rank 1
 answered on 30 Jul 2010
2 answers
92 views
I am using Reporting version 4.0.10.423 and have run into an issue. I have just loaded IE8 and now my reporting toolbar disappears. After reading some threads I did add "

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

"
to my page but I am still having problems with it disappearing.

Any ideas?


Thanks

Dwayne Starkey
Top achievements
Rank 1
 answered on 30 Jul 2010
1 answer
384 views
Hello,

I try to bind a datatable to a table on a report in the C# code.
I could find anything about this topic. Is this possible?

Just want to fill a datatable with two columns and 2 rows. That datatable should be shown on a report.

(or maybe)

When it's possible to bind a filtered Telerik.DataGrid on a report table that would be better.

Chris
Peter
Telerik team
 answered on 29 Jul 2010
0 answers
79 views
I am building the report in code and basically create textboxes and images from a wpf canvas. When the user scales a textbox on the canvas and the program creates a report from the canvas there does not seem to be a may to add the ScaleTransform to the report textbox. I am also allowing the user to rotate the textbox and I am using the angle property to set the textbox angle on the report.

Does anyone know if I can set a scale transform on a report textbox?
Rodney Hilton
Top achievements
Rank 1
 asked on 29 Jul 2010
2 answers
76 views
Hi,

I am trying to Modify the chart Y Axis Item Labels of a report that is displayed in the silverlight report viewer (2010 Q2).
The Reason for this is that I need to modify the Labels into a non standard format string 'HHH:mm:ss' where hours could be more than 24.
I have followed the samples but none seem to work in the silverlight vierwer.
Setting the chart title visible and setting the text does work.
I can debug the code and all the settings are applied but it is as if the report is already rendered or if it is re-rendered after the modifications.
I have tried the code in the NeedDataSource Event but the series (to get the max value) is not available yet.
It is available in the ItemDataBound Event but the .

Am I missing a setting?

Help please....

Code:

chart1.ChartTitle.Visible =

 

true; // works

 

chart1.ChartTitle.TextBlock.Text =

 

"Test setting the value"; // works

 


chart1.PlotArea.YAxis.Clear();

chart1.PlotArea.YAxis.AutoScale =

 

false;

 

chart1.PlotArea.YAxis.AddRange(1, 10000, 10000 / 10);

 

 

for (int ii = 0; ii < chart1.PlotArea.YAxis.Items.Count; ii++)

 

{

chart1.PlotArea.YAxis.SetItemLabel(ii,

 

LabelConverterhelper.ConvertToTimeString((double)chart1.PlotArea.YAxis.Items[ii].Value)); // Does Nothing
// Does not work either

 

 

 

 

//chart1.PlotArea.YAxis[ii].TextBlock.Text = ChartLabelConverter.ConvertToTimeString((double)chart1.PlotArea.YAxis.Items[ii].Value);

 

 

 

 

}

Kobus
Top achievements
Rank 1
 answered on 29 Jul 2010
13 answers
380 views
As it appears that we still don't have matching themes between the Web Viewer and the normal Telerik AJAX controls I am trying to setup my own theme so that there is some consistancy between my main app and the report viewer.  Sorry to sound negative but this is something that should have been added ages ago.

I am having issues.  I put the skin with css and images into a folder called /Styles/ReportViewer/Black now in the code I set the following:
reportviewer.Skin = "Black"
reportviewer.SkinsPath = "/Styles/ReportViewer"

The initial view of the page works but this is before any filter criteria are set and the report viewer doesn't have any data.  If I then hit my Search button and perform an ajax call I see the images in the viere toolbar change to those from the Office2007Blue set.  Interestingly the black background for the toolbar stays but the icons change.

I've tried this with a ~ at the front of the SkinsPath but this time the initial view doesn't work.

I've been using the code from the http://www.telerik.com/community/code-library/reporting/general/applying-custom-skin-to-the-web-report-viewer.aspx example and that doesn't seem to help at all...  Any pointers or has something changed that I'm missing.  I'm using the 2010 Q1 release.

Regards,

Jon
Steve
Telerik team
 answered on 29 Jul 2010
1 answer
95 views
Basically we want to show 5 columns of data on the screen but export 10 columns of data. This is using the silverlight viewer and exporting to csv format.

If I set the width of a column to 0 or set Visible='False' on the textbox in the detail row I get the error: Object reference not set to an Instance of an object.

Is there someway to accomplish this?

Thanks,
Brian

Steve
Telerik team
 answered on 29 Jul 2010
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?