Telerik Forums
Reporting Forum
3 answers
174 views
Hi,
I was testing the latest build (3.1.9.807) for the medium trust support with this code:
protected void Page_Init(object sender, EventArgs e) 
        { 
            Swh.Ih7.Reports.ShopInvoice report = new Swh.Ih7.Reports.ShopInvoice(); 
            report.OrderID = new Guid(Request.QueryString["OrderID"]); 
 
            DisplayPDF(report); 
        } 
 
        void DisplayPDF(Telerik.Reporting.Report reportToExport) 
        { 
            ReportProcessor reportProcessor = new ReportProcessor(); 
            RenderingResult result = reportProcessor.RenderReport("PDF", reportToExport, null); 
 
            string fileName = result.DocumentName + ".pdf"
 
            Response.Clear(); 
            Response.ContentType = result.MimeType; 
            Response.Cache.SetCacheability(HttpCacheability.Private); 
            Response.Expires = -1; 
            Response.Buffer = false
 
            Response.AddHeader("Content-Disposition"
                               string.Format("{0};FileName=\"{1}\""
                                             "attachment"
                                             fileName)); 
 
            Response.OutputStream.Write(result.DocumentBytes, 0, result.DocumentBytes.Length); 
            Response.End();  


But I'm getting security exception:
Server Error in '/' Application. 
-------------------------------------------------------------------------------- 
 
Security Exception  
Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.  
 
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutralPublicKeyToken=b77a5c561934e089' failed. 
 
Source Error:  
 
 
[No relevant source lines] 
  
 
Source File: App_Web_zzaoc31d.4.cs    Line: 0  
 
Stack Trace:  
 
 
[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutralPublicKeyToken=b77a5c561934e089' failed.] 
   Telerik.Reporting.Pdf.Rendering.PdfRenderer.DrawString(String text, PdfFont font, Brush brush, RectangleF rect, Boolean rightToLeft) +0 
   Telerik.Reporting.Pdf.Drawing.PdfGraphics.DrawString(String s, Font font, Brush brush, RectangleF rect, StringFormat format) +124 
   Telerik.Reporting.ImageRendering.CanvasPdf.DrawString(String s, Font font, Brush brush, RectangleF rect, StringFormat format) +107 
   Telerik.Reporting.ImageRendering.TextLine.Render() +1436 
   Telerik.Reporting.ImageRendering.RenderingElement.RenderToPage(RectangleRF clip, RoundedFloat parentLeft, RoundedFloat parentTop) +1864 
   Telerik.Reporting.ImageRendering.RenderingElement.RenderChildren(RectangleRF clip) +161 
   Telerik.Reporting.ImageRendering.RenderingElement.RenderToPage(RectangleRF clip, RoundedFloat parentLeft, RoundedFloat parentTop) +1970 
   Telerik.Reporting.ImageRendering.RenderingElement.RenderChildren(RectangleRF clip) +161 
   Telerik.Reporting.ImageRendering.RenderingElement.RenderToPage(RectangleRF clip, RoundedFloat parentLeft, RoundedFloat parentTop) +1970 
   Telerik.Reporting.ImageRendering.CompositionBase.RenderPageSection(PageArea pageArea, RenderingElement pageSection, Single height) +339 
   Telerik.Reporting.ImageRendering.CompositionBase.ApplyPageSections() +311 
   Telerik.Reporting.ImageRendering.CompositionBase.SendPhysicalPages(Boolean force) +52 
   Telerik.Reporting.ImageRendering.CompositionBase.End() +75 
   Telerik.Reporting.ImageRendering.CompositionPdf.End() +39 
   Telerik.Reporting.ImageRendering.CompositionBase.Dispose(Boolean disposing) +22 
   Telerik.Reporting.ImageRendering.CompositionPdf.Dispose(Boolean disposing) +11 
   Telerik.Reporting.ImageRendering.CompositionBase.System.IDisposable.Dispose() +17 
   Telerik.Reporting.ImageRendering.ImageRendererBase.RenderReport(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback) +242 
   Telerik.Reporting.ImageRendering.ImageRendererBase.Telerik.Reporting.Processing.IRenderingExtension.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback) +21 
   Telerik.Reporting.Processing.ReportProcessor.Render(IList`1 reports, ExtensionInfo extensionInfo, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback) +353 
   Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo, CreateStream createStreamCallback, String& documentName) +421 
   Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo) +108 
   Swh.Reports.Web.UI._Default.DisplayPDF(Report reportToExport) +91 
   Swh.Reports.Web.UI._Default.Page_Init(Object sender, EventArgs e) +184 
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 
   System.Web.UI.Control.OnInit(EventArgs e) +99 
   System.Web.UI.Page.OnInit(EventArgs e) +12 
   System.Web.UI.Control.InitRecursive(Control namingContainer) +333 
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785 
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242 
   System.Web.UI.Page.ProcessRequest() +80 
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21 
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49 
   ASP.ih7shopinvoice_aspx.ProcessRequest(HttpContext context) in App_Web_zzaoc31d.4.cs:0 
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 
 
  
 
 
-------------------------------------------------------------------------------- 
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082  



Chavdar
Telerik team
 answered on 17 Aug 2009
2 answers
115 views
Hi,

I have a StackedBar100 chart in my report, everything works fine, but the problem is the appereance of the percentage result in the Bar.
For example: If I have a bar divided in two or more... the first value appears in the botton of the second part of bar and the other value appears in the top of the second part of the bar. I'd like to see each value appearing inside the correct bar.
Is that possible??

Another Question: I think this code is not good... maybe there is an easy way to do that with the same result.. isnt there??

Thanks...

Code:


    DataTable GetData()
        {
            DataTable dataTable = new DataTable();
            dataTable.Columns.Add("Descricao", typeof(string));
            dataTable.Columns.Add("Qtd1", typeof(int));
            dataTable.Columns.Add("Qtd2", typeof(int));
            dataTable.Rows.Add(new object[] { "A", 3, 5 });
            dataTable.Rows.Add(new object[] { "B", 2, 5 });
            dataTable.Rows.Add(new object[] { "C", 5, 5 });
            return dataTable;
        }


    private void chart2_NeedDataSource(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = new DataTable();
                dt = GetData();


                Telerik.Reporting.Processing.Chart chart = sender as Telerik.Reporting.Processing.Chart;
                chart2.Series.Clear();
                
                ChartSeries s = null;

                for (int i = 0; i < dt.Columns.Count -1; i++)
                {
                    s = new ChartSeries();
                    s.Type = ChartSeriesType.StackedBar100;
                    s.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing;
                    s.DefaultLabelValue = "#%";
                    
                    
                    chart2.Series.Add(s);

                    foreach (DataRow row in dt.Rows)
                    {
                        ChartSeriesItem item = new ChartSeriesItem();
                        item.YValue = Convert.ToDouble(row[i+1]);
                        s.AddItem(item);

                    }
                    
                }

                foreach (DataRow row in dt.Rows)
                {
                    s.PlotArea.XAxis.AutoScale = false; //false permite gerar o xaxis com os valores que eu definir
                    s.PlotArea.XAxis.AddItem((string)row["Descricao"]);

                }


            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Angelo
Top achievements
Rank 1
 answered on 17 Aug 2009
1 answer
67 views
hi
When i am adding a second report file in the solution i m getting errors .I would be thankful if anyone helps me in adding two reports in a single solution
Chavdar
Telerik team
 answered on 17 Aug 2009
6 answers
187 views
I need to change the order of the formats listed in the Export dropdown.  I know I can rename and hide formats, but is there a way to reorder them?

Thanks,
-Stephen
Steve
Telerik team
 answered on 14 Aug 2009
5 answers
342 views
I need to include hyperlinks in my reports when they are rendered in the Web Viewer.  I'm currently using Q3 2008 and everything works fine.  I set the text of the textbox to include HTML like <a href="google.com">Click Me</a>.

I'm in the process of upgrading to Q1 2009, but it looks like my approach doesn't work anymore.  It seems the size of the textbox gets calculated based on the size of the text (including all the HTML code) so the textbox gets really large (even though when the browser processes the text, it's considerably smaller). 

So if I have a textbox who's Text is set to <a href="http://AReallyReallyReallyReallyReallyReallyLongLink.com">Q</a>, the textbox takes up a huge area but it ends up being only 1 characeter.

I thought I might be able to use the HtmlTextBox but it seems to completly ignore (and remove) hyperlinks.

Any suggestions?

Thanks,
-Stephen
Steve
Telerik team
 answered on 13 Aug 2009
2 answers
88 views
Hi,

I'm using Telerik Reporting to create various reports consisting of a page header/footer with 3 groups with headers and footers. When I initially set it up it worked fine for a one page report. If the report grows more than 2 pages it will insert a full page of whitespace inbetween pages. I thought it could be the footers so i made them invisible, set their height to 0, still didn't work. I don't know what could be causing these random pages of whitespace. Have you ever encountered this problem with whitespace pages before or do you have some help for me?

Thanks a million
John Downey
Top achievements
Rank 1
 answered on 12 Aug 2009
11 answers
408 views
Hi,

I have looked at some of the report videos.  I am still not clear about how to use the parameters that one sets on the reports.  I have a couple of DateTime parameters which appear on my report.  They look cool with the Date Picker, but how do I send these parameters to the report?  When I change it does not seem to have any effect on the report.  My SQL query does have parameters in it and they have default values.

Thanks,
Darren
Darren
Top achievements
Rank 1
 answered on 12 Aug 2009
1 answer
354 views
I have a report with several report parameters.  Two of these are datetime parameters which, on initial report start, I want to have set to a null value.

So, I have the parameters set up as Type = DateTime  and  AllowNull = True  and  Value = Null.

In preview mode in VS, it looks fine, both parameters initialize with today's date but with the NULL checkbox on.  This is how I want it.

But when I run the report page, they initialize with no value, NULL NOT checked on, and the 'Invalid Value' icon is showing.

I have tried setting the initial values in the code with:
this.ReportParameters["dateparameter"].Value = null;
but this does not work.

Any ideas?

Dan
Hrisi
Telerik team
 answered on 12 Aug 2009
1 answer
318 views
Hi,

May i pass report's parameters to the web report viewer using the javascript client side api? any sample?
Steve
Telerik team
 answered on 12 Aug 2009
6 answers
764 views
Hi,

I have a List item on my report which is bound to a DB table.  If the List's data source is empty (returns no results), the List item is still generated and on the report the List takes up as much empty space as the List item takes up on the layout in the Designer. I would prefer if the List's data source is empty, that the List item should not even render and any Report items below it should move up to fill its space. Is this possible to achieve?

My problem is particularly severe:

My List is composed of only 3 items - 1 PictureBox to display an image, one TextBox to display the image title, and another TextBox to display a caption for the image.

However, the List is sized quite large to accomodate the PictureBox, the latter of which is 6 in. W x 7 in. H. Consequently, one of these List items intentionally accomodates an entire 8.5x11 page when the report is generated. 

So you see, my problem is should the data source for the List return no results, my List item - given its large dimensions in the Report Designer - still generates a very large empty white space in my report (an entirely blank page in this case). This looks especially silly because the List item is preceeded and followed by other Report Items which contain actual data.  

Gregg
Top achievements
Rank 1
 answered on 11 Aug 2009
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?