Iron Speed Technical Forums
Register Latest Topics
 
 
 


Reply
  Author   Comment   Page 1 of 2      1   2   Next
pk_davidson

Registered:
Posts: 223
Reply with quote  #1 

In December 2010, MVP developer Tim Titchmarsh posted a document on integrating Telerik Reporting with Iron Speed Designer.   

The Telerik Q2 2012 release changed some of the access details.  With Tim's permission, I took his original document, modified it to reflect the Telerik Q2 2012 changes, added some detail, and included notes about some Telerik Reporting usage features (Multi-Value parameters, read only exports, ...)

My intent was to have a document that would completely explain how to manually add Telerik reporting into a web site or web app.

You should view the training videos that discuss integrating other 3rd party tools as well as the videos that show how to utilize other Telerik tools.  These show how to do Telerik integration via drag&drop of toolbox items in Visual Studio. 

I have had moderate success with that process.  Sometimes it works great, sometimes it only partially works, and sometimes not at all.  I suspect this has to do with the complexity of the web site, available ram, etc...  If it works for you, the drag and drop method is fairly painless and saves time.  When it doesn't work, hopefully this document will help out. 

 
Attached Files
doc Telerik_Reporting_in_Iron_Speed_Designer_Revision_2.doc (332.50 KB, 457 views)


__________________
Paul

JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,954
Reply with quote  #2 

I am skipping Q2, from Q1 we will be using now Q2, and probably I can be able give input as well. Thanks Paul for the try. 

 

Cheers,

Jimi J


 


__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

pk_davidson

Registered:
Posts: 223
Reply with quote  #3 
Jimi,
I think all this applies to Q3.  I just upgraded and so far it all seems the same.

__________________
Paul
anr_1204

Avatar / Picture

Registered:
Posts: 18
Reply with quote  #4 
The instructions are for VB code-base only, needs a bit of conversion. It works Ok on me using c# {without the parameter passing though}.


__________________
Alfred Roa
echo4sos

Avatar / Picture

MVP Developer
Registered:
Posts: 172
Reply with quote  #5 
If I may add to this, you do not need to compile your reports into an assembly (dll). You can use the Telerik stand-alone report designer to create your reports. You can create them directly in your Iron Speed application folders or create them elsewhere and copy them to your IS folders. When you create your Telerik ReportViewer, leave out the ReportSource tags. That way you can use Server.MapPath to dynamically set your report source. For example...

Quote:

Public

 

Sub

LoadData()

' LoadData reads database data and assigns it to UI controls.

' Customize by adding code before or after the call to LoadData_Base()

' or replace the call to LoadData_Base().

LoadData_Base()

Dim uriReportSource AsNew Telerik.Reporting.UriReportSource

()

' Specifying a URL or a file path

Const Directory AsString =

"~/YourReportFolder/"

Dim myPath AsString = Server.MapPath(Directory & "YourReportName.trdx"

)

uriReportSource.Uri = myPath

Me

.ReportViewer1.ReportSource = uriReportSource

Me

.ReportViewer1.DataBind()

EndSub

This way you don't have to create a new web project and copy the compiled dll to your Iron Speed application. Also, it's a lot easier to use the stand-alone designer to edit your reports. Another thing, if you name the data source connection string within your report to the same name used in your Iron Speed application (web.config) you do not need a separate app.config file.


__________________
-Bill
pk_davidson

Registered:
Posts: 223
Reply with quote  #6 
Thanks Bill.
Great info. 
The last time I looked at the report designer, it kept crashing on me (beta version.)  With the production release, I was under the impression that using the generator files was much more complicated than you've shown so we didn't go down that path. 

This would be a nice improvement since as you point out, the dll method means recompiling, putting the dll out there, etc...

I'll have to give this a try soon!
How about parameters ?  Do you pass them in the same way?

__________________
Paul
echo4sos

Avatar / Picture

MVP Developer
Registered:
Posts: 172
Reply with quote  #7 
Hey Paul,

I haven't played with parameters or filters just yet. I just got my hands on Telerik Reporting yesterday LOL! I'm quite familiar with Crystal Reports and the Telerik version seems pretty cut and dry. I would imagine being able to pass parameters via code-behind and refreshing the data source with a rebind, much like CR. I'm going to play around with this a bit more and I'll post my results. So far the stand-alone designer has not crashed on me. I'm using the Q3 2012 build. Also, kudos to you and Tim for the nice tutorial!

__________________
-Bill
pk_davidson

Registered:
Posts: 223
Reply with quote  #8 
Good news Bill!
I've talked with another ISD developer who followed your write up and it worked right out of the gate for him.

While I hate to rewrite code and I may not bother with moving reports in our existing dll to external report files, it sure looks like using the Stand Alone generator is the way to go.  Appreciate you posting this.

__________________
Paul
echo4sos

Avatar / Picture

MVP Developer
Registered:
Posts: 172
Reply with quote  #9 
Ha! Awesome! Glad to see it's helpful. Like I said, I'll play around with parameters and the such when I get a chance. As of now, I'm building a custom search function for Telerik reporting. As you probably know, this is one needed feature that is not included, but hopefully will be in the future. I'll post my findings as soon as I can. Happy coding!
__________________
-Bill
pk_davidson

Registered:
Posts: 223
Reply with quote  #10 
I just briefly played their have an import wizard that allows you to pull existing reports out of the dlls into trdx files.  I did have an error importing a report.  There was a duplicate definition of a textbox.  Oddly enough, it compiles and runs just fine under VS.  It's easy to fix, open the trdx source and rename the duplicate definition. 

I think the URIReportSource class might be new with Q3 2013.  I think previously it was more convoluted to use trdx files in a .NET app.  This leads me to think Telerik is moving in the direction of pushing the use of the external tool and trdx files.  Which is fine by me.

It does look like there are some issues with custom user functions that are easier to deal with in the VS where you just add them to the code.  With the external report generator, from my quick read, you have to create an assembly of your custom functions and then add references to them to the xml configuration file.  See Extending Report Designer.  I think your search function will answer this question since you'll be extending the designer with custom code in order to facilitate that.

I look forward to working with Bindings, parameters, user functions, etc... in the external report generator.  But at a first blush, it all has a very similar look & feel to the generator in VS which makes me think the only real issue of any consequence will be user functions.  And that seems fairly straight forward, just an extra step.

__________________
Paul
pk_davidson

Registered:
Posts: 223
Reply with quote  #11 
Any luck with anyone using custom user functions and the external Telerik report designer ?  I have imported an existing report from a dll ok but for the life of me I cannot get it to accept my user function which resides in a seperate dll.
__________________
Paul
echo4sos

Avatar / Picture

MVP Developer
Registered:
Posts: 172
Reply with quote  #12 
Hey Paul,

I actually accomplished what I set out to do with Telerik reporting using the stand-alone designer. As far as custom user functions go, I haven't gotten that far just yet. All I needed to do was filter a report based on an input textbox that the user fills out. When they push the button it rebuilds the report datasource and rebinds itself. I can show you what I'm talking about if you'd like.

What kind of functions are you trying to implement?

__________________
-Bill
pk_davidson

Registered:
Posts: 223
Reply with quote  #13 
Hi Bill:
I finally figured it out.
As usual, the actual solution was pretty trivial once you figure out the actual syntax.
To create UDFs (user defined functions) to be used with the standalone report generator.
What I discovered that is not quite fully documented:
1. Your assembly dll with your needs to be placed in the report generator application's base folder, typically
C:\Program Files\Telerik\Reporting Q1 2013\Report Designer

Telerik says to put it in the application base folder.  I kept putting it in MY applications folder.  A simple example of a path would have been worth a few hours.

2. Add your assembly to the file: Telerik.ReportDesigner.exe.config which is in the folder above.  This is documented at:
http://www.telerik.com/help/reporting/standalone-report-designer-extending-configuration.html

But note that the config file initially has the assembly references sectoin commented out.  I did not catch that at first.  My notepad++ editor didn't recognize the config file as xml and so didn't highlight the comment section.  That DUH on my part took a bit to catch.

3. When calling your UDF, you have to fully reference it:
AssemblyName.MyClassName.MyFunction  (or MyObjectMember to be more exact)

Thanks for the quick response.
BTW - my function is just a type converter to type cast a measurement into a telerik "unit" for changing the size of printing areas based on some bit flags.

NOTE: The above info is for working with the stand alone Telerik Report Generator. 
See the next post for more info related to using stand alone report files with a web site (and app ?)

__________________
Paul
pk_davidson

Registered:
Posts: 223
Reply with quote  #14 

Some further info on getting external reports to work with a web site:
(I imagine a web app is the same)

1. Put your User Defined Function (UDF) assembly dll file into the web site's bin folder.

2. Go into Visual Studio and add a reference to that assembly.
    I don't know if #2 is really required or not.  My UDFs were not working so I did that but it didn't correct the problem.  However, I also didn't remove the reference in VS after I did the following steps which did get it working.  This is a very common thing to do with external assemblies so I can't imagine it will hurt and I strongly suspect it is required, although the reference put into the web.config below may accomplish the same task.

For the following, see:
http://www.telerik.com/help/reporting/configuring-telerik-reporting.html

3. In your web.config file, at the top of the file, just after the first "configSections" tag, add in     
<section name="Telerik.Reporting"type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting" allowLocation="true" allowDefinition="Everywhere"/>

The Telerik page says this should be the first child element in the "configuration" section so ...

4. In your web.config file, just after the closing tag of your runtime section add in a Telerik.Reporting section:
<Telerik.Reporting>
 
<AssemblyReferences>
    <add name="TelerikReportsUDF"version="1.0.0.0"/>
  </AssemblyReferences>
</Telerik.Reporting>

At first I added another line to the namespace section putting in the TelerikReportsUDF (my namespace for my UDFs) but I later commented it out.  It's the report viewer that uses it, not the web site so I don't think you need to add a namespace tag.

I also added, below the runtime tag just after the assemblyBinding xmnls...
<probing privatePath="Bin"/>   because from what I read, this was needed.
However, I later commented it out and everything continued to work. 
I assume web site's just know to search the bin folder.  I also suppose it won't hurt to keep it in there if you want.

At some point I'll modify the full write up to include this info as a seperate method.  There are some advantages to the external trdx file over the dll method.  The prime one being that you can modify the report and not recompile and post a new dll.  Just post the new trdx file  (assuming you don't add any new UDFs.)

On a final note, using parameters was easy.  Here are two hard coded parameters which I'll be switching to URLs soon:

' Adding the two initial parameter values
uriReportSource.Parameters.Add(New Telerik.Reporting.Parameter("ProjectIds", "1609"))
uriReportSource.Parameters.Add(
New Telerik.Reporting.Parameter("BondCycles", "6"))


__________________
Paul
echo4sos

Avatar / Picture

MVP Developer
Registered:
Posts: 172
Reply with quote  #15 
Hey Paul,

Excellent findings! Thanks for sharing all of this great info. I'll post the code I use to dynamically change a .trdx report's datasource as soon as I can so perhaps you and others can use it without banging heads all day trying to figure it all out...LOL!

Thanks again!

__________________
-Bill
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement