Telerik Forums
Reporting Forum
1 answer
130 views
in the following code would it be possible to pass code that deletes a page break and reformats the footer on the docx that the report is converted to.  I am thinking p.invokemethod(method name) or something like that.  This is a workaround to auto page break place in docx document at end of page.  I do not want to add to my app.config as earlier post suggests.

Telerik.Reporting.Processing.RenderingResult result = TelContractrp.RenderReport("DOCX", TelContractirs,deviceInfo);
            string dContract = DateTime.Now.ToString().Replace("/", "");
            dContract = dContract.Substring(0, 12);
            dContract = dContract.Replace(":", "");
            string fileName2 = result.DocumentName + "_" + dContract + "." + result.Extension;
            string filePath2 = System.IO.Path.Combine(saveLocation, fileName2);
            FileStream fs = new FileStream(filePath2, FileMode.Create);
            fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
            fs.Close();
            System.Diagnostics.Process p = new System.Diagnostics.Process();
            p.StartInfo.UseShellExecute = true;
            p.StartInfo.FileName = filePath2;
            p.Start();
Stef
Telerik team
 answered on 22 Jul 2013
3 answers
242 views
Folks

Using RadControls for ASP.NET AJAX Q1 2013 SP2 with Reporting version = 7.1.13.705. In my report I have a SQLDatasource (i.e. SQLDatasource2).

I would like to Filter that Datasource in Page load event of ASP.net not inside Report NeedDataSource event.

This works in Report NeedDataSource event.
private void TestReport1_NeedDataSource(object sender, EventArgs e)
      {
          //Take the Telerik.Reporting.Processing.Report instance
          Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;
           
          string stsql = "SELECT M.ManagerID, C.FirstName + ' ' + C.LastName AS Name, E.Gender FROM  (SELECT DISTINCT ManagerID  FROM HumanResources.Employee) AS M INNER JOIN";
          stsql += " HumanResources.Employee AS E ON M.ManagerID = E.EmployeeID INNER JOIN Person.Contact AS C ON E.ContactID = C.ContactID WHERE (E.Gender = N'F') ORDER BY Name";
          this.sqlDataSource2.SelectCommand = stsql;
         
 
      }


But I would like to filter the Datasource in Page load event of asp.net. I came up with this..

Protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Report1 myReports = new Report1();
 
            Reports.TestReport1 myReport = new Reports.TestReport1();
 
            string stsql = "SELECT M.ManagerID, C.FirstName + ' ' + C.LastName AS Name, E.Gender FROM  (SELECT DISTINCT ManagerID  FROM HumanResources.Employee) AS M INNER JOIN";
            stsql += " HumanResources.Employee AS E ON M.ManagerID = E.EmployeeID INNER JOIN Person.Contact AS C ON E.ContactID = C.ContactID WHERE (E.Gender = N'F') ORDER BY Name";
 
// Need help here to filter SQLDatasource2..
        }
         
    }


Any help is appreciated. I use Asp.net Ajax a lot, trying to implement Telerik Reporting along with Webforms in a new project. Thanks

gc_0620


Peter
Telerik team
 answered on 22 Jul 2013
1 answer
87 views
I am using Visual Studio 2012 .
I created a business Object , created a Telerik Report and have it successfully connected to the business object data source.
The method that gets the data returns a DataTable . I have a column for event Id and another one for duration and If I use a table I am able to see 40 rows with their specific event Id and event duration.

NOW when I use the graph wizard, select the clustered column, select the data source, I put the eventId in Categories and Duration in Values. When I try to preview the report I obtain 40 different empty graphs. Why is that? What am I doing wrong?
I want the information of all the rows to be in ONE graph.

Any help is appreciated!
Thanks!
Peter
Telerik team
 answered on 22 Jul 2013
1 answer
58 views
Hey,

i´v a Little Problem with the Printing Function in the ReportViewer. I want to print an generated Document automaticly, but when i´m opening the Form, i can´t Print the Document, becouse it is not generatet in the Moment. The Generation takes about ca. 1 - 2 Seconds.

Now my Question. How can i check automaticly if the Generation of the Document is finish?

Thangs a lot.
Dee
Stef
Telerik team
 answered on 22 Jul 2013
5 answers
387 views
Hi

I have installed a new font in c:\windows\fonts Folder
I restarted the pc

I can use the new font in Windows Office Word.

But i can't see the new font in telerik reporting designer, why ?

Thanks for any anyswer.
Peter
Telerik team
 answered on 22 Jul 2013
2 answers
378 views
Hello all,

by default, the boolean parameter shows a radio button.
Any chance I can setup a checkbox for my boolean parameter?
Will
Top achievements
Rank 1
 answered on 22 Jul 2013
2 answers
212 views
Hi Telerik,
I have an issue in regards to dynamic reports.
I am adding columns dynamically, but cell is being duplicated for all cells in content section, for each row.
This is my code:
private void table1_ItemDataBinding(object sender, EventArgs e)
        {

           // table is being populated from as WS

            processingTable.DataSource = table;


            //we do not clear the Rows collection, since we have a details row group and need to create columns only
            this.table1.ColumnGroups.Clear();
            this.table1.Body.Columns.Clear();
            this.table1.Body.Rows.Clear();
            int i = 0;
            this.table1.ColumnHeadersPrintOnEveryPage = true;

            // Properties are the object properties - they will represent the columns
            foreach (PropertyInfo property in properties)
            {
                Telerik.Reporting.HtmlTextBox textboxGroup = null;
                Telerik.Reporting.HtmlTextBox textBoxTable = null;

                Telerik.Reporting.TableGroup tableGroupColumn = new Telerik.Reporting.TableGroup();
                this.table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Unit.Inch(1)));

                textboxGroup = new Telerik.Reporting.HtmlTextBox();
                textboxGroup.Style.BorderColor.Default = Color.Black;
                textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
                textboxGroup.Value = property.Name;
                textboxGroup.Size = new SizeU(Unit.Inch(1.1+i), Unit.Inch(0.3));
                tableGroupColumn.ReportItem = textboxGroup;
                


                textBoxTable = new Telerik.Reporting.HtmlTextBox();
                textBoxTable.Style.BorderColor.Default = Color.Black;
                textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
                textBoxTable.Value = "=Fields." + property.Name;
                textBoxTable.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
                this.table1.Body.SetCellContent(0, i++, textBoxTable,1,1);
                this.table1.Items.AddRange(new ReportItemBase[] { textboxGroup, textBoxTable });
                
                this.table1.ColumnGroups.Add(tableGroupColumn);
                
            }

        }
I am attaching the screenshot for it. Basically all contain the same value for all columns, it´s taking the first value I set in
this.table1.Body.SetCellContent(0, i++, textBoxTable,1,1);
but all fields are different for each column.
I am attaching an image with some sample data for one row (fields.png).
Please help.

Thanks,
Unknown
Top achievements
Rank 1
 answered on 19 Jul 2013
1 answer
83 views
I do not have any page breaks on any of my sections or detail and it seems that when I convert to docx programmatically the docx has section breaks within it.  Why is this happening and how can it be prevented.  I have included the conversion code that I am using.

Telerik.Reporting.Processing.ReportProcessor TelContractrp = new Telerik.Reporting.Processing.ReportProcessor();
System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
Telerik.Reporting.InstanceReportSource TelContractirs = new Telerik.Reporting.InstanceReportSource();
TelContractirs.ReportDocument = currRpt;
Telerik.Reporting.Processing.RenderingResult result = TelContractrp.RenderReport("DOCX", TelContractirs,deviceInfo);
 string dContract = DateTime.Now.ToString().Replace("/", "");
 dContract = dContract.Substring(0, 12);
 dContract = dContract.Replace(":", "");
 string fileName2 = result.DocumentName + "_" + dContract + "." + result.Extension;
 string filePath2 = System.IO.Path.Combine(saveLocation, fileName2);
 FileStream fs = new FileStream(filePath2, FileMode.Create);
 fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
 fs.Close();
 System.Diagnostics.Process p = new System.Diagnostics.Process();
 p.StartInfo.UseShellExecute = true;
 p.StartInfo.FileName = filePath2;
 p.Start();
Unknown
Top achievements
Rank 1
 answered on 19 Jul 2013
1 answer
59 views
I have created a Telerik report with a Subreport and parameters, like How To: Create a Master Detail Report.

For the master report I use a Telerik.Reporting.List with a Datasoure and Reportsource parameter like this: new Parameter("TourID", "xxx")

My question is, How can I set the subreport Parameter like
new Parameter ( "TourID", "TourID FROM MasterreportList" ) 
.

thanks for the help.
Unknown
Top achievements
Rank 1
 answered on 19 Jul 2013
1 answer
308 views


We are using the Telerik Reporting Q2 2013 to generate reports within our web application.

When i click on print button or export to pdf, the below issue occur:

Arithmetic operation resulted in an overflow.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.OverflowException: Arithmetic operation resulted in an overflow.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[OverflowException: Arithmetic operation resulted in an overflow.]
   Telerik.Reporting.Pdf.Fonts.TrueType.FontReader.GetFontData(Font font, Boolean& isTTC) +223
   Telerik.Reporting.Pdf.Fonts.TrueType.TrueTypeDescriptor..ctor(Font gdiFont) +312
   Telerik.Reporting.Pdf.PdfFontTable.GetDescriptor(PdfFont font) +92
   Telerik.Reporting.Pdf.PdfFontDictionary..ctor(PdfDocument document, PdfFont drawingFont) +109
   Telerik.Reporting.Pdf.PdfFontType0Dictionary..ctor(PdfDocument document, PdfFont font) +21
   Telerik.Reporting.Pdf.PdfFontTable.GetFont(PdfFont font) +89
   Telerik.Reporting.Pdf.PdfPageDictionary.GetFontName(PdfFont font, PdfFontDictionary& fontDictionary) +66
   Telerik.Reporting.Pdf.Rendering.PdfRendererGraphicsState.Update(PdfFont font, Brush brush, Int32 renderMode) +47
   Telerik.Reporting.Pdf.Rendering.PdfRenderer.Update(PdfFont pdfFont, Brush brush, Int32 renderMode) +59
   Telerik.Reporting.Pdf.Rendering.PdfRenderer.DrawString(String text, PdfFont font, Brush brush, RectangleF rect, Boolean rightToLeft) +52
   Telerik.Reporting.ImageRendering.CanvasPdf.DrawString(String s, Font font, Brush brush, RectangleF rect, StringFormat format) +174
   Telerik.Reporting.ImageRendering.DocumentBase.WriteTextChunk(String text, RectangleF bounds, RectangleF chunkBounds, RectangleF chunkBoundingRectangle, IFont font, Color foreground, Single angle, StringFormat format) +254
   Telerik.Reporting.Writing.TextLineWriter.WriteContent(DocumentWriter writer, TextLine textLine, ElementPageInfo pageInfo) +342
   Telerik.Reporting.Writing.ContentElementWriter`1.Write(T element, ElementPageInfo pageInfo, DocumentWriter writer) +100
   Telerik.Reporting.Writing.ElementWriter`1.Telerik.Reporting.Writing.IElementWriter.StartWrite(LayoutElement element, ElementPageInfo pageInfo, DocumentWriter writer) +68
   Telerik.Reporting.Writing.WriteStartOperationsDispatcher.Write(IElementWriter writer, LayoutElement element, ElementPageInfo pageInfo, DocumentWriter documentWriter) +19
   Telerik.Reporting.Writing.WriteOperationsDispatcher.Visit(TextLine textLine) +46
   Telerik.Reporting.Processing.TextLine.Accept(ProcessingElementVisitor visitor) +12
   Telerik.Reporting.Processing.ProcessingElementVisitor.Visit(LayoutElement element) +20
   Telerik.Reporting.Writing.DocumentWriter.Telerik.Reporting.BaseRendering.IWriter.WriteStartElement(LayoutElement element, ElementPageInfo pageInfo) +29
   Telerik.Reporting.BaseRendering.PageHandler.Telerik.Reporting.Paging.IPageHandler.StartElement(LayoutElement element, ElementPageInfo info) +14
   Telerik.Reporting.Paging.PageStartElement.AddToPage(IPageHandler handler) +19
   Telerik.Reporting.Paging.PageElementLayer.AddToPage(IPageHandler handler) +69
   Telerik.Reporting.Paging.PageElementManager.AddToPage(IPageHandler handler) +34
   Telerik.Reporting.Paging.PageCompositionBase.AddElementsToPage() +31
   Telerik.Reporting.Paging.PageCompositionBase.SendPhysicalPages() +38
   Telerik.Reporting.Paging.PageCompositionBase.OutputPage() +551
   Telerik.Reporting.Paging.PageCompositionBase.CreatePages() +727
   Telerik.Reporting.Paging.PagerBase.Telerik.Reporting.Paging.IPager.CreatePages(IPageHandler handler, Report report) +42
   Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback) +311
   Telerik.Reporting.Processing.ReportProcessor.RenderCore(ExtensionInfo extensionInfo, IList`1 reports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback) +864
   Telerik.Reporting.Processing.ReportProcessor.RenderCore(String format, IList`1 reports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback) +49
   Telerik.ReportViewer.WebForms.ReportExportOperation.RenderReport(String format, IList`1 processingReports, Hashtable deviceInfo, IRenderingContext renderingContext) +229
   Telerik.ReportViewer.WebForms.ReportRenderOperation.PerformOperationOverride() +206
   Telerik.ReportViewer.WebForms.HandlerOperation.PerformOperation(HttpContext context, ICacheManager cacheManager) +49
   Telerik.ReportViewer.WebForms.BasicHandler.ProcessRequest(HttpContext context) +182
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69


Anyi help would be appreciated.



Stef
Telerik team
 answered on 19 Jul 2013
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?