Telerik Forums
Reporting Forum
2 answers
64 views
I'm trying to set available columns as a list and allow callers to make them visible at run-time. Maybe I'm trying to do too much with the available tools, but my approach is much preferred over traditional report parameters for the following reasons:

1. I can define columns programmatically and make them available as a list to the callers without the caller having to know the column names at compile-time.
2. Callers can choose which columns to make visible, change the size, etc at run-time.

So basically I have a List<ReportColumn> collection and a List<SortableColumn> collection. I populate these collections in the report constructor.

I then bind a checkbox list in the caller to allow the user to specify which columns to show. I also bind a drop-down to allow the user to pick which column to sort on.

I then have methods ShowHideColumn(string key, bool visible) and SetSortColumn(string key, SortDirection direction) available for the caller to chose which columns to show and sort by.


My problem is that setting these properties on the list are simply wiped away the next time the constructor is run. Is there a way to preserve these values. Web caching perhaps? I'd rather not use caching if there is a better way to preserve them, but i will do what i have to to preserve the binding functionality.

Thanks,

Scott

protected void btnRunReport_Click(object sender, EventArgs e)
    {
        CompensationStatement report = new CompensationStatement();
        report.ReportParameters["ProducerNumber"].Value = ddlProducerNumber.SelectedValue;
        report.ReportParameters["Month"].Value = DateTime.Parse(ddlMonth.SelectedValue);
        
        //Indicate which columns to show.
        foreach (ListItem li in cblstAvailableColumns.Items)
        {
            bool columnExists = report.ShowHideColumn(li.Value, li.Selected);

            if (!columnExists)
            {
                Elmah.ErrorSignal.FromCurrentContext()
                    .Raise(new Exception(string.Format(
                        "An attempt was made to execute report 'Compensation Report' with invalid parameter '{0}'. This indicates a bug.", li.Value)));
            }
        }

        report.SetSortColumn(
            ddlSortColumn.SelectedValue, 
            (Telerik.Reporting.Data.SortDirection)Enum.Parse
            (typeof(Telerik.Reporting.Data.SortDirection), ddlSortDirection.SelectedValue, true));
        
        this.ReportViewer1.Report = report;
    }
Steve
Telerik team
 answered on 29 Oct 2010
6 answers
877 views
Hi,
I try to show pictures in the Report Details Section and simply don't bring it to work. I filled a DataSet with some images and gave it as DataSource to the Report.

During the ItemDataBinding event I wand to set the Value Property of my PictureBox:

private
void Detail_ItemDataBound(object sender, System.EventArgs e)
{

    DataSet ds = (DataSet)DataSource;
    System.Drawing.
Bitmap image = 
        (System.Drawing.
Bitmap) ds.Tables["Maps"].Rows[RowIndex]["MapImage"];
    PictureMap.Value = image;
    RowIndex++;
}

As result I get this error:

[ArgumentNullException: Der Wert darf nicht NULL sein.
Parametername: encoder]
 System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams) +386727
 System.Drawing.Image.Save(Stream stream, ImageFormat format) +36
 Telerik.Reporting.HtmlRendering.ImageRenderer.SaveImageInStream(HtmlRenderingContext context, Image img, String uniqueImageID, String mimeType) +80
 Telerik.Reporting.HtmlRendering.ImageRenderer.Render(ReportItemBase item, HtmlRenderingContext context) +85
 Telerik.Reporting.HtmlRendering.HtmlItemRender.Telerik.Reporting.HtmlRendering.IReportItemRender.Render(ReportItemBase item, RenderingContext context) +67
 Telerik.Reporting.HtmlRendering.RenderingContext.Render(ReportItemBase item) +47
 Telerik.Reporting.HtmlRendering.Matrix.Render(HtmlRenderingContext context) +1159
 Telerik.Reporting.HtmlRendering.ReportSectionBaseRenderer.Render(ReportItemBase item, HtmlRenderingContext context) +75
 Telerik.Reporting.HtmlRendering.HtmlItemRender.Telerik.Reporting.HtmlRendering.IReportItemRender.Render(ReportItemBase item, RenderingContext context) +67
 Telerik.Reporting.HtmlRendering.RenderingContext.Render(ReportItemBase item) +47
 Telerik.Reporting.HtmlRendering.HtmlPage.RenderBodyInternal(HtmlWriter bodyWriter) +598
 Telerik.Reporting.HtmlRendering.HtmlPage.Render(HtmlTextWriter writer, HtmlRenderingContext renderingContext) +152
 Telerik.Reporting.HtmlRendering.HtmlReport.Render(HtmlTextWriter writer) +353
 Telerik.Reporting.HtmlRendering.HtmlRenderingExtension.Telerik.Reporting.Processing.IRenderingExtension.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback) +260
 Telerik.Reporting.Processing.ReportProcessor.Render(String format, Report reportDefinition, Hashtable deviceInfo, CreateStream createStramCallback) +136
 Telerik.ReportViewer.WebForms.ServerReport.Render(HttpResponse response, String format, Int32 pageNumber, Boolean refresh) +784
 Telerik.ReportViewer.WebForms.ReportPageOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) +72
 Telerik.ReportViewer.WebForms.HttpHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +118
 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303
 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

Any ideas?

Greetings,
Alexander Brütt
C
Top achievements
Rank 1
 answered on 29 Oct 2010
2 answers
103 views
Hello Sir

I have implement reporting in my applicaiton and it's work fine.

I have requirement of End-User Reporting.

Means Different user can create their own report as per their requirement.
Is this possible to create in your Tool ?

Please give me proper solution for that.

Thanking you.

Kishor Dalwadi
Kishor Dalwadi
Top achievements
Rank 2
 answered on 29 Oct 2010
2 answers
185 views
Hi,

Is it possible to remove the column header row from a cross tab.

I have a main report and a sub report, The subreport just has a cross tab on it
In the main report detail section i include the subreport and currently get:

Sub Report
[Col1]    -    [Col2]    -    [Col3]    -    [Total]
  0       -    1000      -     0        -    1000 

In the Main Report I Get

{GroupHead}      [Itemcode]    -    [Count1]    -    [Count2]  
                                                                     [Col1]    -    [Col2]    -    [Col3]    -    [Total]
{DetailSection}  ItemCode      -    400         -    250     -     
 0         -    1000      -     0        -    1000

What i want to do is get the header columns from the Sub report onto the main report Group header Line

David
Top achievements
Rank 2
 answered on 29 Oct 2010
1 answer
101 views
Hello.

Is it possible to hide the component tray when the page is in design mode? I would like to get some more space when I'm designing the report.

Thanks
Best regards
Augusto
Steve
Telerik team
 answered on 29 Oct 2010
1 answer
790 views
I can't open a few of my reports in design view no matter what i do. I followed the tutorial at set up a separate Reporting Library for just the reports, but for a select few reports it gives me the error "Object of type 'Telerik.Reporting.Drawing.Unit' cannot be converted to type 'Telerik.Reporting.Drawing.Unit'." when i try to view the report in design view. I created a new blank application and i still get the same error when trying to open the reports. I can send it to whoever if it would help. thanks.
Steve
Telerik team
 answered on 29 Oct 2010
1 answer
186 views
Hi Telerik team,

I got a problem with bar graph customization in Telerik report version Q2 2009. My customer requirement is they want to fixed the length size of each bar graph to "Millimeter" unit. For example, if data count is 12 items, each bar's width must be 2 mm. But if data count is 3 items, each bar's width must be 8 mm (make it bigger).
Is it possible to do that? I see the graph usually adjust the width of each bar by automatic based on amount of item and graph area.

Regards,
Jiraphat Jokdee
Ves
Telerik team
 answered on 28 Oct 2010
1 answer
99 views
I am trying to add some styling to a crosstab in my report.  I have added different colors to different sections of the report.  When I view the report in the designer preview, the colors show up fine.  When I run the project though, I am not accurately seeing all of my changes.  When I export to PDF though, I can see all of the changes there.

A second part to this questions, is that I have removed the borders for every cell in the crosstab.  No matter what I change though, I still get lines around every cell in the pdf export.

Any help would be appreciated. Thanks.
Steve
Telerik team
 answered on 28 Oct 2010
1 answer
103 views
Hi,

Is it possible in a report to have a vertical logo in the left margin ?, how would I do that ?.

Best

Ole.
Steve
Telerik team
 answered on 28 Oct 2010
4 answers
274 views
Hi,

I have bought Telerik_Reporting_Q2_2010_v4_1_10_9x  today.
I had developed the application using Telerik_Reporting_Q2_2010_v4_1_10_7x trial version using a patch from the forum and the subreports with horizontal &vertical lines were working

But the same code is not working with 9x version.
I am attaching the screenshot of how its looking.

Please help us with some sort of patch to fix the problem.

Regards,
Suman.
Steve
Telerik team
 answered on 28 Oct 2010
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?