This is a migrated thread and some comments may be shown as answers.

Reportbook in Q2

28 Answers 656 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bernie
Top achievements
Rank 1
Bernie asked on 14 Jun 2012, 09:19 AM
Hi ... after update to 2012/Q2 i cannot figure out, how to convert my code to your new reportsource system:

protected void BTN_Process_Click(object sender, EventArgs e)
        {
            ReportBook reportbook = new ReportBook();
            ReportViewer1.Report = null
 
            foreach (GridDataItem si in RG_Reports.SelectedItems)
            
                string ReportName = si.OwnerTableView.DataKeyValues[si.ItemIndex]["Report"].ToString();
 
                Type reportType = Type.GetType(Server.UrlDecode(ReportName));
                Telerik.Reporting.Report report = (Telerik.Reporting.Report)Activator.CreateInstance(reportType);
 
                report.ReportParameters["Filter"].Value = Session["FilterTextAsset"];
                report.ReportParameters["FilterExA"].Value = Session["FilterExA"];
                report.ReportParameters["IsActive"].Value = Session["FilterIsCheckedAsset"];
                report.ReportParameters["OrgUnitId"].Value = Request.QueryString["OrgUnitId"];
                report.ReportParameters["AssetId"].Value = Request.QueryString["AssetId"];
                report.ReportParameters["UserId"].Value = Session["UserId"];
                report.ReportParameters["IsInStock"].Value = Session["FilterIsInStockAsset"];
                report.ReportParameters["IsOrder"].Value = Session["FilterIsOrder"];
                 
                report.ReportParameters["Group1"].Value = new string[] { "" };
                report.ReportParameters["Group2"].Value = new string[] { "" };
 
                report.ReportParameters["Sort1"].Value = "";
                report.ReportParameters["Sort2"].Value = "";
 
                reportbook.Reports.Add(report);
            }
 
            if (RG_Reports.SelectedItems.Count != 0)
            {
                reportbook.DocumentName = "Assets";
                ReportViewer1.Report = reportbook;
            }
             
        }

this code doesn't work anymore!

Thank you!

28 Answers, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 15 Jun 2012, 02:09 PM
Hi Peter,

Basically you will have to create a new InstanceReportSource which you can pass to the Report Viewer ReportSource. What you have to do in order to pass the Report Book is something like this:
InstanceReportSource reportSource = new InstanceReportSource();
reportSource.ReportDocument = new YourReportBook();
ReportViewer1.ReportSource = reportSource;

If you need to assign the data source of a Report in the Report Book in the ReportSource for example you can do that:
reportSource.ReportDocument.Reports.Where(rep => rep.Name == "ReportName").FirstOrDefault().DataSource = myDataSource;

I hope that helps.

Kind regards,
IvanY
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Bernie
Top achievements
Rank 1
answered on 15 Jun 2012, 02:21 PM
Thank you! ... Could you post a small "YourReportBook()" example because I want to add reports dynamically to a reportbook and assign it to a reportviewer! ... your sample http://www.telerik.com/help/reporting/designing-reports-reportbook-web-viewer.html doesn't work!!! Thank you!
0
IvanY
Telerik team
answered on 18 Jun 2012, 01:02 PM
Hello Peter,

I have attached a sample based on our examples.

Greetings,
IvanY
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Bernie
Top achievements
Rank 1
answered on 18 Jun 2012, 02:31 PM
Thank you for your sample ... I have tried to reproduce and after I got following error:

Field in TypedReferences cannot be static or init only.

at System.TypedReference.MakeTypedReference(Object target, FieldInfo[] flds)
at System.Runtime.Serialization.ObjectManager.DoValueTypeFixup(FieldInfo memberToFix, ObjectHolder holder, Object value)
at System.Runtime.Serialization.ObjectManager.CompleteObject(ObjectHolder holder, Boolean bObjectFullyComplete)
at System.Runtime.Serialization.ObjectManager.DoNewlyRegisteredObjectFixups(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Web.Util.AltSerialization.ReadValueFromStream(BinaryReader reader)
at System.Web.SessionState.SessionStateItemCollection.ReadValueFromStreamWithAssert()
at System.Web.SessionState.SessionStateItemCollection.DeserializeItem(String name, Boolean check)
at System.Web.SessionState.SessionStateItemCollection.get_Item(String name)
at System.Web.SessionState.HttpSessionStateContainer.get_Item(String name)
at System.Web.SessionState.HttpSessionState.get_Item(String name)
at Telerik.ReportViewer.WebForms.ViewerSession.get_ReportSource()
at Telerik.ReportViewer.WebForms.ParametersPage.get_ReportDocument()
at Telerik.ReportViewer.WebForms.ParametersPage.get_ParamsManager()
at Telerik.ReportViewer.WebForms.ParametersPage.CreateChildControls()
at System.Web.UI.Adapters.ControlAdapter.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at Telerik.ReportViewer.WebForms.ParametersPage.OnPreLoad(EventArgs e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


I hope you have an idea! (I'm using Webforms!!!)

Thank you!!!
0
Steve
Telerik team
answered on 18 Jun 2012, 02:59 PM
Hello Peter,

Out-proc session is currently broken in the latest Q2 release and we're working on fixing it. We would do our best to address it for the upcoming internal build coming by the end of the week.

Sorry for the temporary inconvenience.

All the best,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Bernie
Top achievements
Rank 1
answered on 19 Jun 2012, 11:19 AM
Thank you!
0
Erick Burgess
Top achievements
Rank 1
answered on 19 Jun 2012, 09:24 PM
Any idea when this fix will be included in an official Service Pack? Since we use CDN on our production site, we are unable to use internal builds, since they do not support the use of CDN.
0
Steve
Telerik team
answered on 20 Jun 2012, 06:50 AM
Hi Erick,

Telerik Reporting does not have such restrictions and the internal builds are fully functional, probably you're referring to the RadControls for ASP.NET AJAX.

Regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Bernie
Top achievements
Rank 1
answered on 25 Jun 2012, 08:49 AM
Hello again ... after updating to 6.1.12.621 I get following error message with out-proc ... without everything works fine!

Invalid value of report parameter 'Sort1'.

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.Exception: Invalid value of report parameter 'Sort1'.

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:

[Exception: Invalid value of report parameter 'Sort1'.]

[CancelProcessingException: An error has occurred while processing the report. Processing canceled. Check the InnerException for more information.]
   Telerik.Reporting.Processing.Report.ValidateParameters() +245
   Telerik.Reporting.Processing.Report.ProcessItem() +41
   Telerik.Reporting.Processing.ReportItemBase.ProcessElement() +46
   Telerik.Reporting.Processing.ProcessingElement.Process(DataMember dataContext) +107
   Telerik.Reporting.Processing.Report.Process(DataItemState state, Boolean processItemActions, Boolean documentMapEnabled) +62
   Telerik.Reporting.Processing.ReportProcessor.ProcessReport(ReportSource reportSource, IDictionary processingContext) +876
   Telerik.Reporting.Processing.ReportProcessor.ProcessReport(ReportSource reportSource, Hashtable deviceInfo, Hashtable renderingContext) +384
   Telerik.ReportViewer.WebForms.ReportRenderOperation.ProcessReport(ReportSource reportSource, Hashtable deviceInfo, Hashtable renderingContext) +99
   Telerik.ReportViewer.WebForms.ReportRenderOperation.PerformOperationOverride() +136
   Telerik.ReportViewer.WebForms.ReportPageOperation.PerformOperationOverride() +79
   Telerik.ReportViewer.WebForms.HandlerOperation.PerformOperation(HttpContext context, ICacheManager cacheManager) +48
   Telerik.ReportViewer.WebForms.BasicHandler.ProcessRequest(HttpContext context) +178
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.547


it's the same with every report-parameter !!! Thank you for your help...
0
Steve
Telerik team
answered on 26 Jun 2012, 03:48 PM
Hello Peter,

We have not been able to reproduce such an issue locally, we used the demo reports that have parameters and they function correctly. It would be best to open a support ticket and attach a runnable report/project that exhibits the problem. Once we review it, we would be able to provide you with more information.

All the best,
Steve
the Telerik team

FREE WEBINAR ON THE NEW REPORT DESIGNER! Join us on Friday, June 29 at 10:00 AM PST for a comprehensive demo of the official version of the standalone Report Designer and find out how easy it is to empower your users with creating, editing and sharing ad-hoc reports. You may even win a free Telerik Ultimate Collection license! Register today >>

0
Bernie
Top achievements
Rank 1
answered on 27 Jun 2012, 08:21 AM
Did you try it with out-proc session? ... without it works!

Thank you!
0
Steve
Telerik team
answered on 27 Jun 2012, 11:15 AM
Hi Peter,

Yes we have tried our demo reports with out-proc session with v.6.1.12.621 and they all function as expected. Can you try them on your end and verify they work? If that is the case, clearly there is something specific on your end causing the problem and it would be best to open a support ticket and attach a runnable report/project that exhibits the problem. Once we review it, we would be able to provide you with more information.

All the best,
Steve
the Telerik team

FREE WEBINAR ON THE NEW REPORT DESIGNER! Join us on Friday, June 29 at 10:00 AM PST for a comprehensive demo of the official version of the standalone Report Designer and find out how easy it is to empower your users with creating, editing and sharing ad-hoc reports. You may even win a free Telerik Ultimate Collection license! Register today >>

0
Bernie
Top achievements
Rank 1
answered on 28 Jun 2012, 08:44 AM
Hi Steve!

I tried to reproduce this issue in a sample project and I figured out that the problem is to set a report parameter to a "string.empty" or "".

So if you do: report.ReportParameters["Test1"].Value = ""; a system exception occurs.
You can solve this problem by allowing "Null-Values" in the report-parameter, but the checkbox is not nice to see!

It is easy to reproduce!

protected void Button1_Click(object sender, EventArgs e)
   {
       InstanceReportSource reportsource = new Telerik.Reporting.InstanceReportSource();
       ReportBook reportbook = new ReportBook();
       ReportViewer1.ReportSource = null;
 
       Telerik.Reporting.Report report = new Telerik_Ex01_Class.Report1();
 
       report.ReportParameters["Test1"].Value = "";
       reportbook.Reports.Add(report);
 
       reportsource.ReportDocument = new MyReportBook(reportbook);
       this.ReportViewer1.ReportSource = reportsource;
       this.ReportViewer1.RefreshReport();
   }
 
   public class MyReportBook : Telerik.Reporting.ReportBook
   {
       public MyReportBook(Telerik.Reporting.ReportBook rb)
       {
           foreach (Telerik.Reporting.Report rp in rb.Reports)
           {
               this.Reports.Add(rp);
           }
           this.DocumentName = "Test";
       }
   }

This only occurs with "out-proc session" ... I hope you can fix this!

Thank you!
0
Steve
Telerik team
answered on 28 Jun 2012, 01:34 PM
Hi Peter,

Thanks for that, we were able to reproduce the problem and we're currently looking into it and we would fix it for subsequent release of the product.

Kind regards,
Steve
the Telerik team

FREE WEBINAR ON THE NEW REPORT DESIGNER! Join us on Friday, June 29 at 10:00 AM PST for a comprehensive demo of the official version of the standalone Report Designer and find out how easy it is to empower your users with creating, editing and sharing ad-hoc reports. You may even win a free Telerik Ultimate Collection license! Register today >>

0
Bernie
Top achievements
Rank 1
answered on 04 Jul 2012, 07:14 AM
Hi Steve!

Can you tell me, when the new internal build will be released! Since Q2/2012 released my project has been suspended!!!

Thank you!
0
Steve
Telerik team
answered on 04 Jul 2012, 11:23 AM
Hello Peter,

It would be released by the end of the week.

Greetings,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Jian
Top achievements
Rank 1
answered on 17 Jul 2012, 06:24 PM

After we upgrated to Q2 2012, all our existing reports received the same error: "Field in TypedReferences cannot be static or init only." The reports are ok in visual studio Preview/Html Preview but broken when accessing from webform. Is this issue related to the Q2 release? Thanks for the help!

 

0
David
Top achievements
Rank 2
answered on 19 Jul 2012, 01:57 AM
Me too, out of proc session (state server) seems to cause issue, works fine locally.
0
Chavdar
Telerik team
answered on 20 Jul 2012, 10:07 AM
Hi,

The issues with the out-proc session have been already fixed. Please, log in to your account and download the latest internal build.

Kind regards,
Chavdar
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
David
Top achievements
Rank 2
answered on 20 Jul 2012, 11:06 PM
Thanks :-) tested and working great, thank you!
0
Bernie
Top achievements
Rank 1
answered on 02 Aug 2012, 12:44 PM
Hi..
i have another issue with out-proc session... I'm using following code to sort and group der report depending on report parameters. this works fine without out-proc session.

code-part:
string GroupTotal = "";
string DocMapTotal = "";
 
detail.Visible = true;
//detail.DocumentMapText = null;
groupHeaderSection2.Visible = true;
labelsGroupHeader.Visible = true;
 
Telerik.Reporting.Group group1 = Groups[0];
group1.Groupings.Clear();
group1.Sortings.Clear();
 
Telerik.Reporting.Group Group2 = Groups[1];
Group2.Groupings.Clear();
Group2.Sortings.Clear();
Report.Sortings.Clear();
 
// SORTING
// =======
if (ReportParameters["Sort1"].Value.ToString() != string.Empty)
{
    Report.Sortings.Add(new Telerik.Reporting.Sorting("=" + ReportParameters["Sort1"].Value.ToString(), Telerik.Reporting.SortDirection.Asc));
}
if (ReportParameters["Sort2"].Value.ToString() != string.Empty)
{
    Report.Sortings.Add(new Telerik.Reporting.Sorting("=" + ReportParameters["Sort2"].Value.ToString(), Telerik.Reporting.SortDirection.Asc));
}
 
// GROUPING
// ========
if ((((object[])(ReportParameters["Group1"].Value))[0]).ToString() != string.Empty)
{
    foreach (object o in (object[])ReportParameters["Group1"].Value)
    {
        GroupTotal += o.ToString() + "+";
        DocMapTotal += "IsNull(" + o.ToString() + "," + (char)34 + (char)34 + ") +' - '+";
    }
    GroupTotal = GroupTotal.Substring(0, GroupTotal.Length - 1);
    DocMapTotal = DocMapTotal.Substring(0, DocMapTotal.Length - 8);
 
    if (GroupTotal != string.Empty)
    {
        //Telerik.Reporting.Group group1 = Groups[0];
        group1.Name = "group1";
 
        group1.Groupings.Add(new Telerik.Reporting.Grouping("=" + GroupTotal));
        group1.Sortings.Add(new Telerik.Reporting.Sorting("=" + GroupTotal, Telerik.Reporting.SortDirection.Asc));
        group1.DocumentMapText = "=" + DocMapTotal;
        TB_Section1.Value = "=" + DocMapTotal;
        if ((bool)ReportParameters["PageBreak1"].Value == true)
        {
            groupFooterSection1.PageBreak = PageBreak.After;
        }
        else
        {
            groupFooterSection1.PageBreak = PageBreak.None;
        }
        Groups[0].GroupFooter.Visible = true;
    }
}
else
{
    Groups[0].GroupFooter.Visible = false;
}

after updating to version v6.1.12.717 I received following error:

[ArgumentNullException: Der Wert darf nicht NULL sein.]
   Telerik.Reporting.Xml.ObjectXmlWriter.ResolveName(Object o) in c:\temp\reporting\@RBuild-31703\Reporting_Build\Net20\Telerik.Reporting.Xml\ObjectXmlWriter.cs:34
   Telerik.Reporting.Xml.ObjectXmlWriter.SerializeCore(Object obj) in c:\temp\reporting\@RBuild-31703\Reporting_Build\Net20\Telerik.Reporting.Xml\ObjectXmlWriter.cs:79
   Telerik.Reporting.Xml.ObjectXmlWriter.Serialize(Object obj, String defaultNamespace) in c:\temp\reporting\@RBuild-31703\Reporting_Build\Net20\Telerik.Reporting.Xml\ObjectXmlWriter.cs:74
   Telerik.Reporting.Xml.XmlSerializer.Serialize(TextWriter writer, Object value, String defaultNamespace) in c:\temp\reporting\@RBuild-31703\Reporting_Build\Net20\Telerik.Reporting.Xml\XmlSerializer.cs:60
   Telerik.ReportViewer.Common.XmlSerializer.Serialize(Object o) in c:\temp\reporting\@RBuild-31703\Reporting_Build\Net20\Telerik.Reporting.Processing\ServerReportViewerHistory.cs:358
   Telerik.ReportViewer.WebForms.SerializableReportSourceWrapper.System.Runtime.Serialization.ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) in c:\temp\reporting\@RBuild-31703\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\SerializableReportDocument.cs:96
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) +453
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) +54
   System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +542
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +133
   System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer) +1762

[HttpException (0x80004005): Der Sitzungszustand kann nicht serialisiert werden. Im 'StateServer'- und 'SQLServer'-Modus serialisiert ASP.NET die Sitzungszustandsobjekte, sodass nicht serialisierbare Objekte bzw. MarshalByRef-Objekte nicht zulässig sind. Diese Beschränkung gilt auch, wenn eine ähnliche Serialisierung im Custom-Modus durch den benutzerdefinierten Sitzungszustandsspeicher ausgeführt wird.]
   System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer) +1847
   System.Web.SessionState.SessionStateItemCollection.WriteValueToStreamWithAssert(Object value, BinaryWriter writer) +34
   System.Web.SessionState.SessionStateItemCollection.Serialize(BinaryWriter writer) +638
   System.Web.SessionState.SessionStateUtility.Serialize(SessionStateStoreData item, Stream stream) +244
   System.Web.SessionState.SessionStateUtility.SerializeStoreData(SessionStateStoreData item, Int32 initialStreamSize, Byte[]& buf, Int32& length, Boolean compressionEnabled) +67
   System.Web.SessionState.SqlSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +140
   System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +807
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75



Thank you for you help!

Peter
0
Steve
Telerik team
answered on 07 Aug 2012, 12:07 PM
Hi Peter,

Where are you using this code? As we can see it does not do anything peculiar that cannot be accomplished by wiring filters, sortings and groups from within the report designer itself i.e. have this directly done in the report designer. You can use the Report Parameters inside any dialog that allows expressions (see Using Report Parameters in Expressions).
The logic of whether to apply or not a page break can be moved into an User Functions like this:

public static PageBreak DefinePageBreak(bool value)
       {
           if (value == true)
           {
               return PageBreak.None;
           }
           else
           {
               return PageBreak.Before;
           }
       }

and used directly in a Binding:

Property Path                        Expression
===============================================================
PageBreak                             = DefinePageBreak(Parameters.Parameter1.Value)

where Parameter1 is your report parameter of Boolean type.

Greetings,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Bernie
Top achievements
Rank 1
answered on 07 Aug 2012, 12:41 PM
Hi Steve!

Thank you for your advise! I'll try it later. The code belongs to the "ItemDataBinding" event in the report and it worked fine with the previous build and without "out-proc-session". with "out-proc-session" the code didn't work (= no sorting, no grouping --> nothing!!!!)

I installed your latest int. build 717 and the reportviewer-control (webforms) cannot be opened (error details pls. see my previous post) with "out-proc-session" enabled.

Thank you!!!

0
Steve
Telerik team
answered on 08 Aug 2012, 08:33 AM
Hello Peter,

As mentioned in my previous post, what you were doing programmatically in a report event was never a recommended solution. Please follow my suggestion and add your sortings/groupings logic directly from the report designer, other logic which cannot be done via the designer should be moved to user functions that are used in binding expressions.

Kind regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Bernie
Top achievements
Rank 1
answered on 20 Aug 2012, 02:11 PM
Hello Steve!

What I'm doing is the recommended solution in your reporting documentation... please see:

http://www.telerik.com/help/reporting/data-items-how-to-add-groups-to-report-item.html
and
http://www.telerik.com/help/reporting/data-items-how-to-add-sorting-to-report-item.html

I was playing around with your "user-function" solution, but there is no binding expression for sorting und and no expression for grouping...

following example doesn't work:

[Sortings]
= Sigma_Reports.Functions.Sort(Parameters.Sort1.Value)

public static SortingCollection Sort(string sort1)
        {
            SortingCollection rSort = new SortingCollection();
            rSort.Add(new Telerik.Reporting.Sorting("=" + sort1, Telerik.Reporting.SortDirection.Asc));
            return rSort;
        }

Thank you!
0
Steve
Telerik team
answered on 23 Aug 2012, 10:59 AM
Hi Peter,

There seems to be a misunderstanding. The main purpose of the help articles you've referenced is to show how to add sorting and grouping via the report designer and with code. As you can see the code snippets in those articles create a new group and new sorting i.e. the code snippets show you how the code looks like when generated from the report designer - when you inspect the InitializeComponent method you would find this code. Never have we advised in these articles to use this code in report event! Working with report definition items in report events leads to unexpected behavior and problems, this is noted in the Understanding Events help article.

Regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Bernie
Top achievements
Rank 1
answered on 23 Aug 2012, 01:01 PM
thank you steve!
now I know, but this doesn't solve my problem. maybe you can post a small example, how to create dynamic grouping and sorting, depending on report parameters.What I did (2 years ago) is:
1.) created a dynamic grid with all my reports
2.) on this selection I add the reports to a reportbook
3.) the user can decide how to sort and group and can set some filters to the report.

thank you!
0
Steve
Telerik team
answered on 23 Aug 2012, 01:17 PM
Hi Peter,

It would be best if you open a support ticket and attach a runnable excerpt from your original project or a new sample project that works in the previous version, but does not work with the latest version. This way we can advise you accordingly, whether this should have worked in a first place (or worked incidentally) and how you might proceed with the desired scenario.

Note that we do not require your actual reports or data, you can use sample data such as DataTable/Business objects for the sake of a runnable sample.

Greetings,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Bernie
Top achievements
Rank 1
Answers by
IvanY
Telerik team
Bernie
Top achievements
Rank 1
Steve
Telerik team
Erick Burgess
Top achievements
Rank 1
Jian
Top achievements
Rank 1
David
Top achievements
Rank 2
Chavdar
Telerik team
Share this question
or