DotNet Wrangler

Icon

My Tracks

.Net RDLC Report Viewer Control

Hello Friends,

From last 6-7 months I am working on RDLC Reports.

I want to share my presentation on rdlc ; which was presented by me in my company.

This presentation is required more verbal information;

Please feel free for ask any question on this presentation and give me a chance to explore more in RDLC.

http://vijays.files.wordpress.com/2006/12/reporting-vs201.ppt

About these ads

Filed under: DotNet

103 Responses

  1. Hi Vijay, good presentation.
    I have a question, have you figured out the way to localize reports?

    I have found some really hard examples about it. I’ve managed to localize some strings that I have on a sparate dll assembly adding it as a reference, but I could not use, so far, strings from an App_GlobalResources resource file (ASP.net VS2005 site)

    Feel free to reach me at sgomez at deklarit dot com.

    Best Regards,
    Sebastián

  2. AJITH says:

    Hi Vijay,

    I am very new to RDLC report viewer, i have a doubt regarding the formatting of strings. how to add bullets and numbering for strings and how to display HTML data in the report.

    Pls help me..

    Regards
    Ajith.

  3. vijays says:

    Hi Ajith,

    I have found that this is not possible in RDLC. If you find then please let me know.
    The solution may be an XSLT file , because RDLC is an XML document and support XSLT also.
    but i have not used it.
    what i m doing is just copy the bullet from word and paste in text box control and just put it with my text line text box.

    Best wishes
    Vijay

  4. kumar says:

    Hi vijay,
    i am a new in rdlc report i need to learn linecharting in rdlc with parameter passing would u plz give me a article this related.

    regards
    kumar

  5. kumar says:

    Hi vijay,

    i want to learning the rdlc reportviewer would u plz send me some real time rdlc coding. This is my mail id: tm555@rediffmail.com

    with regards
    kumar

  6. vijays says:

    Hi Kumar,

    This is the link,
    you can find various examples there. http://www.gotreportviewer.com/
    For more info mail me vshandilya[at]del.aithent.com

    Best wishes
    Vijay

  7. Rathish says:

    I am doing project on report viewer . Can you tell me how can i get print option in the tool bar of report viewer. I can find in windows application but not in Web forms . Can you help me

  8. Don says:

    Hi Rathish,

    There are two versions of the ReportViewer control — a Web server version and a Windows Forms version. The ReportViewer Web server control can be used in two processing modes — remote and local. If you use it in remote processing mode (with SQL Server Reporting Services), you will get a Print button in the toolbar. If you use it in local processing mode, you will unfortunately not get a Print button in the toolbar (however, you if you export the on-screen report to PDF or Excel, you will be able to print from those apps. This applies to Visual Studio .NET 2005 as well as Visual Studio .NET 2008. For more, see this link ==> http://msdn2.microsoft.com/en-us/library/ms251771(VS.80).aspx.

    Regards,
    -Don

  9. Vijay says:

    Hi Rathis,
    You can print your report with the help of a JavaScript print button or creating your own print button on the page.
    Don is right, but its true that with RDLC report print option will not visible although you can use the toolbar properties and the showprintbutton property.
    I will try to solve it as soon as possible.

    Regards,
    Vijay

  10. Vijay says:

    Hi Rathis,
    I think this link will give you a diffrent way to do it.

    http://msdn2.microsoft.com/en-us/library/ms252091.aspx

    Regards,
    Vijay

  11. Vijay says:

    Hi Rathis,

    Same issues
    with some diffrent solutions.

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=339099&SiteID=1

    Regards,
    Vijay

  12. Mani Kumar says:

    Hi Vijay,
    Your presentation is very useful to me. But it the reportviewer the print button didnt show. So how to show and work reportviewer with printbutton. please help me.

    With Regards
    Mani Kumar

  13. Vijay says:

    Hi Mani,

    You can check my previous replys on the same problem.

    Vijay

  14. Mani Kumar says:

    Hi Vijay,

    Thanks for reply. Your previous replys all are using .xml file. I have used the report viewer with local database. I didnt created the .xml file. I have used the report viewer directly to the sql server 2005 db. That i have implemented db using web.cofig in appsettings. Kindly reply me

    Thanks in Advance
    Mani Kumar

  15. Hi, Mr. Vijay.

    Do you know the way to print the report in Local Processing mode?
    Please help me…

    Regards,

    Adi Novriansyah

  16. uma says:

    Hi vijay,
    i am a new in rdlc report i need to learn dynamic dataset and in rdlc with parameter passing would u plz give me a article this related.

    with regards
    uma

  17. uma says:

    Hi vijay,
    i want to know dynamic reportviewer in a rdlc and also dynamic report would u plz give me a article about this ….
    with regards
    uma

  18. uma says:

    Hi vijay,
    i want to know paging and page break in a rdlc would u plz give me a article about this ….
    with regards
    uma

  19. Satya says:

    Hi Vijay,

    How can we break the text into multiple lines in rdlc? HTML is not working. Can you please give some solution asap.

    Thanks,
    Satya

  20. Vijays says:

    Hi Satya,

    Just do this

    =Fields!AName.Value +System.Environment.NewLine() +”Add new line content here”

    what ever you put after “System.Environment.NewLine() ” comes in new line.

    Thanks & Regards
    Vijay

  21. Vijays says:

    Hi Uma,

    What we do lets solve one by one.
    Your first 2 problems not sound clear to me, please elaborate what exactly you are looking for.

    Your 3 problem has a solution use it with some intelligence.
    Create a group with this expression
    =Int((RowNumber(Nothing)-1)/25) in your table/list or what ever you are using to show the data. Check page break at end check box of that group.
    Here 25 is the number of record per page.

    I assume you know what you want to do.
    try this solution with some changes.

    Thanks and Regards,
    Vijay

    • Jinal says:

      Hi, i want to display 10 records per page. I applied formula what you specified but i am getting each record on different page rather than 10 records

      Please reply

  22. uma says:

    Hi Vijay,
    How can we display -ve balance in one column of a table and +ve balance in another column of the same table in a report(i dn’t want to display both +ve and -ve in the same column of a table) is there any sql query.

  23. uma says:

    Hi Vijay,
    how can we pass parameter in runtime in rdlc report not to another report page (its like stored procedure).

    Thanks & Regards
    Uma,

  24. uma says:

    Hi Vijay,
    how can i print subtotal of first page inthe top of 2nd page.plzzzzzz…. reply me as soon as possible bez its very urgent right now i am working on reports only and i am new to .net actually i am from java background.

    Thanks & Regards
    Uma,

  25. Vijays says:

    Hi Uma,

    Yes you can do it,
    Its a bit tricky what you have to do is…
    1. Assign the value of subtotal text box to that box that is on the next page.
    2. Set that text box so that it can appear on the second page.

    Hope you can do it :).
    Regards
    Vijays.

  26. Bhushan says:

    Hi Vijay,

    i’m showing report on basis of dropdownlist(Bar/pie) but it shows only 1st time(correct), second time it not show second report,but shows data in 1st report only
    why ? plz check my following code & guide me to solve this

    ReportViewer1.ProcessingMode = ProcessingMode.Local
    If DropChartType.SelectedValue = “Bar” Then
    ReportViewer1.LocalReport.ReportPath = “Report1.rdlc”
    ElseIf DropChartType.SelectedValue = “Pie” Then
    ReportViewer1.LocalReport.ReportPath = “Report2.rdlc”
    End If
    ReportViewer1.LocalReport.DataSources.Clear()
    ReportViewer1.LocalReport.DataSources.Add(reportDSCab)
    ReportViewer1.DataBind()
    ReportViewer1.DocumentMapCollapsed = True
    ReportViewer1.LocalReport.Refresh()
    ReportViewer1.Visible = True

    :-)
    bhushan

  27. neha says:

    hi vijay
    m using reportviewer(rdlc) in windows app.i want to use parameter,start date n end date ,.user should give value to see the report in specified date range.i tried alot but,itz not showing parameter prompt.plz help me out.

  28. uma says:

    neha beta how ru you can do did by 2 way…….

  29. uma says:

    hi vijay
    i didn’t get properly how to do display subtotal in top of next page plz… explain it properly now only our pl scolding us plz.. help me.

  30. BharathReddy says:

    hi Vijay,

    i am presently working in rdlc and rdl reports . i have got two things to ask u.let me ask one by one.

    first whether there is any way were we can display a word or pdf files in our reports that is through rdlc reports.

    and send is can u help to know how to get dynamic images in the header of the report for all the pages. (here what i am getting is i am getting the image only only in the first page when i try to get it dynamicaly but i am getting it to all pages when i show static)

    Thanks

    with regrads

    Bharathreddy

  31. gita kansara says:

    Hello,

    I am trying to create a rdlc report.

    One of the fields in the report contains HTML formatted information. e.g. (It’s a text field which is populated from a Rich Text Editor similar to one we have here).

    When I put the content of this, in a text box of RDLC file, it shows HTML instead of formatted output.

    I have been doing this in Crystal Reports using Text Format tag in there.

    Is there some similar option available for RDLC text box too? I could not find any.

    Thanks,

  32. Raghavendra rao N says:

    Hi,
    iam working on Rdlc in asp.net
    in report viewer control there is no option to print directly like rdl in sqlreporting services

    how to add print option to my report viewer control
    pls help me

    Thanks n regards
    raghavendra rao

  33. Rajesh Vyas says:

    Hi

    I am also using Rdlc file and report viewer control in one of my website.Its working fine on local server but when i am deploying it ,It shows error.

    coding is like this………..

    //declare Connection, command and other related objects

    SqlConnection conReport = new SqlConnection(ConfigurationManager.ConnectionStrings[“cn”].ConnectionString);

    SqlCommand cmdReport = new SqlCommand();

    SqlDataReader drReport;

    DataSet dsReport = new DataSet1();
    try
    {

    //open connection

    conReport.Open();

    //prepare connection object to get the data through

    //reader and populate into dataset

    cmdReport.CommandType = CommandType.Text;

    cmdReport.Connection = conReport;

    cmdReport.CommandText = “Select * from tblBank”;

    //read data from command object

    drReport = cmdReport.ExecuteReader();

    //new cool thing with ADO.NET… load data directly

    //from reader to dataset

    dsReport.Tables[0].Load(drReport);

    //close reader and connection

    drReport.Close();

    conReport.Close();

    //provide local report information to viewer

    ReportViewer1.LocalReport.ReportPath =

    Server.MapPath(“rptProductList.rdlc”);

    //prepare report data source

    ReportDataSource rds = new ReportDataSource();

    rds.Name = “DataSet1_dtProductList”;

    rds.Value = dsReport.Tables[0];

    ReportViewer1.LocalReport.DataSources.Add(rds);

    ReportViewer1.LocalReport.Refresh();

    }

    catch (Exception ex)
    {

    Response.Write(“Exception is:” + ex);

    }

    finally
    {

    //check if connection is still open then attempt to close it

    if (conReport.State == ConnectionState.Open)
    {

    conReport.Close();

    }

    }

    Is there any problem in coding for deployment or something else.
    Please help me out and thanks in advance………..

  34. Rajesh Vyas says:

    Hi

    I am also using Rdlc file and report viewer control in one of my website.Its working fine on local server but when i am deploying it ,It shows error.

    coding is like this………..

    //declare Connection, command and other related objects

    SqlConnection conReport = new SqlConnection(ConfigurationManager.ConnectionStrings[“cn”].ConnectionString);

    SqlCommand cmdReport = new SqlCommand();

    SqlDataReader drReport;

    DataSet dsReport = new DataSet1();
    try
    {

    //open connection

    conReport.Open();

    //prepare connection object to get the data through

    //reader and populate into dataset

    cmdReport.CommandType = CommandType.Text;

    cmdReport.Connection = conReport;

    cmdReport.CommandText = “Select * from tblBank”;

    //read data from command object

    drReport = cmdReport.ExecuteReader();

    //new cool thing with ADO.NET… load data directly

    //from reader to dataset

    dsReport.Tables[0].Load(drReport);

    //close reader and connection

    drReport.Close();

    conReport.Close();

    //provide local report information to viewer

    ReportViewer1.LocalReport.ReportPath =

    Server.MapPath(”rptProductList.rdlc”);

    //prepare report data source

    ReportDataSource rds = new ReportDataSource();

    rds.Name = “DataSet1_dtProductList”;

    rds.Value = dsReport.Tables[0];

    ReportViewer1.LocalReport.DataSources.Add(rds);

    ReportViewer1.LocalReport.Refresh();

    }

    catch (Exception ex)
    {

    Response.Write(”Exception is:” + ex);

    }

    finally
    {

    //check if connection is still open then attempt to close it

    if (conReport.State == ConnectionState.Open)
    {

    conReport.Close();

    }

    }

    Is there any problem in coding for deployment or something else.
    Please help me out and thanks in advance………..

    Rajesh Vyas
    Uganda East Africa

  35. vijays says:

    Hi Rajesh,
    If your code is running on local machine then it should work fine on the server.

    You can check these things.

    1. What is the error that comes on when you deploy it.
    2. If possible to debug the code, then debug it and, look in to the base exception if any.
    3. Connections on your server database and right of user by which your application is trying to connect to the database.

    It helps me to solve your problem.

    Vijay

  36. Shyamala says:

    Hi ,
    i want to set the value of the textbox control at runtime.can you help me by send the coding for that?

  37. Glora says:

    Hi, I am using the rdlc report with a business object as the data source. My data source returns an IList. The employee class has a child class of Person which has two properties for first and last name. I am able to render the column for first name as Fields!employee.Value.person.firstName..and it is working. But, if I specify the same in the interactive sort, it does not work. How do I implement the interactive sort for this column. Thanks

  38. Hey,
    The rdlc report can be rendered as pdf/excel even without using the reportviewer control on page.

    here is the code http://dotnetsoldier.blogspot.com/2008/12/generate-pdf-from-local-report.html

  39. Arvind says:

    Hello Vijay,

    I have a RDLC report and I am displaying it on the Report Viewer Control in my front end application. I get the report perfectly and theres no problem in it.

    But the problem arises when I try to export the report to a PDF (using available option – basically the inbuilt option).
    I get the report in 3 pages whereas my client wants it to be in a single page.

    Can something be done abt it so that I can control the size of the report???
    Please reply soon.

  40. Vijays says:

    Hi Arvind,

    Please check following things to correct it.
    1. All the 3 pages have data, it comes perfectly or not ?.
    2. Check the width of the report, some time it happens that extra width generates extra pages.
    3. If you want to that your report should display data of 3 pages in 1 page than you should create a landscape or portrait size of page (I am talking about that you should change the way of showing data).

    Let me know where you are with your problem.

    ~Vijay

  41. Arvind says:

    Well Vijay,

    Actually, I will make my problem statement more clear. Yes Data comes in all the three pages (i.e) it essentially is a single chart and the same chart is divided into 3 parts and gets displayed in 3 different pages. I have tried printing in both Landscape and Portrait but I still I dont see any difference.

    All I want is the chart should come in one page. Also, am very new to RDLC files, so I dont have any clue about width and size properties.
    Please help me out.

    Thanks,
    Arvind.

  42. Jane says:

    what is the benefits of RDLC compare to RDL?

  43. Jane says:

    when to use RDLC or RDL?

  44. Jane says:

    I have a button on form and I need to load rdlc report to Report Viewer when I click on button.Any idea?

  45. Ravi says:

    Hi..
    i am also new to Reports..I have one problem…how we will change column name in table & Page title with C# code

  46. Neha More says:

    I have got a solution for rdlc from your ans..
    Thanks

  47. Sujit says:

    Hi,

    I am very much new to rdlc reports. I am using that in web forms. I would like to know if there is a way to modify line positions, height, width etc. at runtime? Also, I would like to know if it is possible to modify table positions, ht. width, border settings etc. at runtime and how to do that? I am very much frustrated because I was able to do such sort of things very easily in Crystal Reports. Thanks in advance for your support.

  48. Neha More says:

    Hi,
    At runtime, when I click on print layout, the page break is not work and the extra pages also add…
    Plz tell me the solution
    thanks

  49. milind says:

    hello Arvind,
    actually i have faced the same problem , just try it by changing your heigt or width, and you will have report on one page.
    in my view there is no connection between how report display before export and after export.
    exort option is more related to height and width properties which is available in
    1.open rdlc report
    2. Report menu->Report properties->Layout tab
    3.try by setting page height and width
    4. you will get your output

    thanks

  50. milind says:

    please elaborate your problem.
    Have you set Page breakes against your control like table,matrix etc. that you are using?
    If not then set it, you will get solution.

    thanks

  51. milind says:

    Hello Vijay
    I have one matrix in RDLC report. I have set one table of two rows in matrix cell. Report preview and export to pdf is fine but it is not exported properly in excel.
    In excel format it is showing columns and rows properly but in matrix cell(where we have set table) it is showing
    “Data Regions within table/matrix cells are ignored.”

    thanks

  52. milind says:

    Hi Neha
    please elaborate your problem.
    Have you set Page breakes against your control like table,matrix etc. that you are using?
    If not then set it, you will get solution.

    thanks

  53. Bharat Sharma says:

    Hi Vijay,

    I have a report that contains 34 pages, but its unable to render the next page, it always shows the first page on pressing the next page button. I have added a page break in the group edit as suggested: Create a group with this expression
    =Int((RowNumber(Nothing)-1)/25) in your table/list or what ever you are using to show the data. Check page break at end check box of that group.
    Here 25 is the number of record per page.

    but still the next page does not work.
    Please give a direction.
    Bharat

  54. graven says:

    Hi vijay,

    nice presentation!good work!..
    i have a report with textboxes, one with long contents and below is another textbox. When i view on it control the layout is perfect but when i export it to pdf the txtbox contents was overlapping..

    did you guys already encounter similar issues?..
    i hope u can share any workaround on this..
    thanks!
    keep on posting!..

  55. himanshu Porwal says:

    hello Vijay,

    I want to ask you that whether there is any way through which we can add a button to the tool box of the ReportViewer Control as i want to add a button such that if any onee cliks on that button then the report will be mailed to the user.
    the code for mailing the report will be written by me. you just tell me is there any way of doing this.

    Secondly can we have the formatting functionality for the body region at run time.

  56. Jane says:

    I have a problem to load rdlc report in report viewer
    I am getting error:The source of the report definition is not specified
    here is my code:
    private void LoadCurrentReport()
    {
    //string assemblyReportingName = “ZBI.PortfolioSystems.Reporting.Reports”;
    Assembly[] asmlist = AppDomain.CurrentDomain.GetAssemblies();

    foreach (Assembly asm in asmlist)
    {
    string asmname = asm.FullName;
    int indx = asmname.IndexOf(“,”);
    string asmShortName = asmname.Substring(0, indx);
    if (asmShortName == assemblyReportingName)
    {
    string reportClassName = assemblyReportingName + “.Departments.” + CurrentDepartment + “.” + CurrentReport + “.rdlc”;
    Stream stream = asm.GetManifestResourceStream(reportClassName);

    reportViewer1.LocalReport.LoadReportDefinition(stream);
    return;

    We are getting report rdlc from Dll

  57. Vijays says:

    Hi Jane

    try out this before loading the stream to the report viewer control.

    ReportViewer rv1 =new ReportViewer(); //Your object of Report Viewer
    rv1.LocalReport.ReportEmbeddedResource = string.Format(“{0}.Dir Struture .{1}”, typeof(Class Name).Namespace, reportName);

    Instead of that…

    /*********************Your code *************/
    string reportClassName = assemblyReportingName + “.Departments.” + CurrentDepartment + “.” + CurrentReport + “.rdlc”;

    Let me know whether its working or not.
    ~Vijay

  58. bhushan says:

    hi vijay,
    matrix shifting its column posion while copy & pesting on ppt, how to fix this ?

    also is there any way to copy rdlc graph directly to power point ?

  59. bhushan says:

    hi vijay,
    i also have some doubt,about rdlc Report
    1]is there any way to access chart control through programme ?
    means i want to pass Height & Width of chart throug code behind is it possible ?
    2]% wise graph type microsoft provide but it not reflected when runnging graph ,any reason?
    3]is it possible to show total of staked column ?
    4]is there any way to pass x-Axis & Y-Axis fields through programme?

    Thank You.

  60. Jithu says:

    Hi Vijay,

    I am rendering the RDLC out put as .JPEG. When the data is less, only few lines of data and the remaining part is white space as the report size specified is for A4 . Is there any way we can assign page size dynamically?

    Thanks in Advance,
    Jithu

  61. Naga says:

    Hello vijai,

    This is naga.Iam new for RDLC.

    Iam worried about this question.

    Please enlighten me, how to pass the parameter to show the reports(report.rdlc) in reportviewer using vb.net ?

    I can generate the reports for all records of table to show in reportviewer using report.rdlc file.

    But now I dont know how to pass the parameter to show the seleted records to generate the reports in reportviewer using report.rdlc file.

    for example if records having dates, the parameters from ’03-jan-09′ to ’31-jan-09′

    Could you understand my difficulty as other sources coud not help me. From the search in the web also did not help me to understand.

    I need example code for this in vb.net. kindly help me.

    Thanks in advance for ur help.

  62. Gagan Deep Gupta says:

    Hi
    I am new to Microsoft ReportViewer, i have a query regarding some dynamic processes.
    I am working on VB.NET 2008.
    I have near around 150 reports to be build, now these reports have commone main headers, but the difference is in table – header, detail and footer.

    Is it possible to create the Report – table from code behind and pass it to Reportviewer to render.
    This would be of greate help for me if it can work.
    Please let me know, i am on deadline.

    Thanks in advance
    Gagan Deep Gupta

  63. Thanasekaran says:

    Hi
    How can i align the matrix report in the page center..?
    Please help me………

    thanks in advance

    regards
    Thana

  64. Vijays says:

    Create Report Template for your redundant work.

    Here’s how to create a basic template:

    1. Launch Visual Studio .Net and build a report using the Report Project
    Wizard. (Don’t worry much about the data source or the columns you add to the
    report because you’ll delete those later.)

    2. Add a page header and page footer (via the “Report” menu) then add a
    corporate logo and other fields to the header and footer.

    3. Save everything and exit Visual Studio.

    4. Use an XML or text editor to open the “rdl” file that was created in your
    report project folder by the process above.

    5. Remove everything between and except the and
    2.000in tags.

    6. Remove everything between the and tags,
    including the tags themselves. Do the same for the and
    tags.

    7. Save the file.

    8. Place a copy of the rdl file into C:\Program Files\Microsoft SQL
    Server\80\Tools\Report Designer\ProjectItems\ReportProject.

    8. Launch VS.Net and create a new report project, but this time select the
    “Report Project” icon instead of the “Report Project Wizard” icon.

    9. Once the project is created, right click on the “Reports” folder in the
    Solution Explorer and select “Add” then “Add New Item”.

    10. You should see your new template under “Templates” in the “Add New Item”
    dialog box. Select it and build a new report from it.

    [Above points from the same source]
    Go through with the following link for more information :http://www.ureader.com/message/1264333.aspx

  65. Thywil says:

    Hi Vijays how can i write an expression to return different colors to a text box depending on certain conditions met using RDLC(REPORT) in dot 2005.

  66. Vijays says:

    Hi Thywill,

    Select the text box, press F4 go to the properties section for the background, a dropdown appears select Expression and type your condition for the color.
    like =iif(1 < 2,"Red","Green")
    ~Vijay.

  67. Naga says:

    Hello vijai,

    This is naga.
    I already posted on April 1st. Still now i didn’t get any answer. please friend.help me. kindly reply for my problem to me. please consider this,

    Iam new for RDLC.

    Iam worried about this question.

    Please enlighten me, how to pass the parameter to show the reports(report.rdlc) in reportviewer using vb.net ?

    I can generate the reports for all records of table to show in reportviewer using report.rdlc file.

    But now I dont know how to pass the parameter to show the seleted records to generate the reports in reportviewer using report.rdlc file.

    for example if records having dates, the parameters from ‘03-jan-09′ to ‘31-jan-09′

    Could you understand my difficulty as other sources coud not help me. From the search in the web also did not help me to understand.

    I need example code for this in vb.net. kindly help me.

    Thanks in advance for ur help.

  68. Vijay says:

    Hi Naga,
    This is the code,but it is old try to understand and use it.
    this is simple webform and simple button click event.
    Please let me know if you have any problem to understand this code let me know again.
    let me know I will let you know this process step by step.

    happy coding….
    ~Vijay

    Imports Microsoft.Reporting.WebForms
    Imports Microsoft.Reporting
    Imports System.Data.SqlClient
    Imports System.Data
    Imports System
    Imports System.Collections.Generic
    Imports System.Configuration

    Partial Class Default4
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim com1 As New SqlCommand
    Dim bplconnection As New SqlConnection
    bplconnection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings(“webShoppe”).ConnectionString

    com1.Connection = bplconnection
    bplconnection.Open()
    com1.CommandText = “select * from Authors”
    Dim ds As New DataSet
    Dim da As New SqlDataAdapter(com1)
    da.Fill(ds, “Authors”)
    bplconnection.Close()
    Dim lcr As New LocalReport
    Dim rDS As New ReportDataSource(“ds”)
    Dim param As Dictionary(Of String, String) = New Dictionary(Of String, String)
    param.Add(“Name”, “Vijay”)
    Dim datasource As ReportDataSource = New ReportDataSource(“DataSet1_Authors”, ds.Tables(0))
    ReportViewer1.LocalReport.DataSources.Add(datasource)
    ReportViewer1.LocalReport.ReportPath = “D:\Visual Studio 2005\WebSite1\Report1.RDLC”
    Dim count As Int16 = 0
    Dim parm(count) As ReportParameter
    Dim iparamCount As Int16 = 0
    For Each key As String In param.Keys
    Dim value As String = String.Empty
    param.TryGetValue(key, value)
    parm(iparamCount) = New ReportParameter(key, value.ToString())
    ReportViewer1.LocalReport.SetParameters(parm)
    iparamCount += 1
    Next

    ReportViewer1.LocalReport.Refresh()
    End Sub

    End Class

  69. Shankar says:

    HI,
    Is it possible to access a table inside rdlc report in code behind….

    regards
    Shakar.C
    SpireTEK

  70. Shankar says:

    Hi,

    I need to set page break for a table inside rdlc report . for every 20 rows inside a table need a page break. is it possible ?…..
    regards
    Shankar.C

  71. Shankar says:

    Hi Vijay,

    I gone Through the solution u provided, my problem is im having 3 grouping, by ur solution it counts only detail section in table for calculating row numbrs,wat abut group header, and footer rows its not come into counting… Thanks.

    regards ,
    Shankar.C

  72. mahi says:

    hi Vijay..

    i need ur help in this regard..
    i have a report showing 2 villages group by Village_code.
    village1 have 25 pages and village2 have 7 pages
    i need my paging should display like..

    for village 1:page1 of 25,page2 of 25 etc and for Village 2: page1 of 7,page2 of 7.

    pls help me…

    page 1: page 1 of

  73. vj says:

    I have rdlc report in landscape (11X8.5in) that I am exporting to pdf/excel.
    Pdf is working fine, when I export to excel , page is spliting into 2. How can I get excel also to print to landscape one page , instead of 2 landscape pages.

  74. Naga says:

    Mr.Vijay

    This is naga. thanks for your respponse.I was tried to pass the parameter in rdlc report in web form by using your method.But still now i get an error like (An error occurred during local report processing).So I cant understand to pass the parameter.You told me try your method, if i get suffered you will help for doing this step by step process. please help me.

    Could you understand my difficulty as other sources coud not help me. From the search in the web also did not help me to understand.

    I need example code for this in vb.net. kindly help me.

  75. NN says:

    Hi Mr Vijay,

    I have a table and show item with
    =Int((RowNumber(Nothing)-1)/15)

    I want to show some total information at the end, show I place them on the footer of the table.

    When print preview, they are on the same page (1 page only), but when print out or export, they are splitted into 2 pages.

    Do you have any solution ?

    Thank you very much !

  76. Naga says:

    Hello Mr.Vijay

    This is Naga, First I say to thank for your response, I was tried your code , but still I am get suffered. I cant to be get correct answer.

    Here I write the code

    Imports Microsoft.Reporting.WinForms
    Imports Microsoft.Reporting
    Imports System.Data.SqlClient
    Imports System.Data
    Imports System
    Imports System.Collections.Generic
    Imports System.Configuration

    Public Class Form1
    Dim con As New SqlConnection(“data source=.\SQLEXPRESS;initial catalog=Testing;integrated security=true”)

    Dim cmd As New SqlCommand
    Dim dr As SqlDataReader
    Dim query As String
    Dim query1, str As String
    Dim dapp As New SqlDataAdapter
    Dim ds As New DataSet

    Dim k As Integer

    Dim dt As New DataTable

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub BtnSelect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSelect.Click

    Dim con As New SqlConnection(“data source=.\SQLEXPRESS;initial catalog=Testing;integrated security=true”)

    cmd.Connection = con
    con.Open()
    cmd.CommandText = “Select * from Staff”
    Dim ds As New DataSet
    Dim da As New SqlDataAdapter(cmd)
    da.Fill(ds, “Staff”)
    con.Close()
    Dim lcr As New LocalReport
    Dim rDS As New ReportDataSource(“ds”)
    Dim param As Dictionary(Of String, String) = New Dictionary(Of String, String)
    param.Add(“Age”, TxtAge.Text)
    Dim datasource As ReportDataSource = New ReportDataSource(“TestingDataset”, ds.Tables(0))
    ReportViewer1.LocalReport.ReportPath = “D:\Report\Reportviewer\Reportviewer\Report1.rdlc”

    Dim count As Int16 = 0
    Dim parm(count) As ReportParameter
    Dim iparamCount As Int16 = 0
    For Each key As String In param.Keys
    Dim value As String = String.Empty
    param.TryGetValue(key, value)
    parm(iparamCount) = New ReportParameter(key, value.ToString())
    ReportViewer1.LocalReport.SetParameters(parm)
    iparamCount += 1
    Next
    ReportViewer1.LocalReport.Refresh()
    End Sub
    End Class

    Error message is:

    An error occurred during local report processing.

    Still now I am getting suffered sir, please help to do pass the parameter in rdlc file in step by step method. And also using the stored procedure method to pass the parameter also in rdlc.

    Can you give me your mail id, I send to you the snap shots of worked forms sir,

    Pls help to recover from the troubled sir, please

  77. animesh says:

    hi thanks for the information i want to ask that i have table in my report and i want to set the size of footer of that table to 0 can u helpme

  78. Priya.S says:

    Hi

    I cannot carryover the Grand Total to next page in the ” Report Viewer ” .

    Thank you

  79. revathi says:

    hi

    i m revathi
    i hav one question
    how to use reportheader and footer in rdlc
    .net 2008

  80. Shankar.C says:

    Hi,

    I need to set page break for a table having 3 groups in rdlc report . for every 20 rows inside a table i need a page break, that 20 rows should include group headers and footers too… is it possible ?…..
    regards
    Shankar.C

  81. revathi says:

    Hi

    I hav a problem while fixing no of rows in a table in Rdlc or how to set page size dynamically.
    how to fix it

  82. Arshi says:

    i have one field in rdlc report which is adress n that must be display in multiline. but it comes in single line so, i can do it
    Thanks in Advance

  83. Anand says:

    Hi, Vijay

    I am using Matrix in report viewer, now my requirement is i want to show only 8 columns in matrix i.e. i want to show data weekly basis and i take horizontal in sum total in sub total. if i select 15 days it should show paging while export it will export all 15 days data not 7 days data. and i am using three matrix on one page.

  84. jaffer says:

    hi i working in rdlc report 8.0 that would not contain a print button. iwants dynamic print button for printing can u help me

  85. Veeru says:

    this is great boss..thanks a lot

  86. Revathi says:

    hi Vijay i need to Calculate sub total for each page in RDLC report How to do this

  87. Revathi says:

    How to calculate Page Sub total in RDLC Report

  88. Santosh says:

    How to change the Backcolor of entire row into
    the matrix?

    I tried with IIF & InScope() but it changes
    the color only related columns.

    e.g.

    ——————————————
    Title——CT01—CT02—CT03
    ——————————————
    DP01——-Change-Change-NotChanged
    ——————————————
    PR01——-50—–60—–70
    ——————————————
    DP02——-Not—-Not—-Change Color
    ——————————————
    PR02——-50—–20—–30
    ——————————————

    So it changes color related to specific dept
    not all the row

  89. Ed says:

    Hi!
    I have two table headers one contains the text “Assignment” and the other contains the expression “=Fields!TotA1.Value” Why is it that I am just getting zero (0) and not the correct value of the field?

    I have done the same thing before and its working fine, but why is it that with my new app its not?

  90. darshan thacker says:

    hi,
    this is darshan. i am facing problem in RDLS print layout and printing report. my report is having 23 columns and 30 rows like that i have replicated that print twice on one page. in print priview its not showing right side table with all values while left table is showing properly.

    page width : 13.40917in
    page height : 2.71875in
    what could be the solution ?

  91. Myron Joy says:

    To dynamically generate the RDLC file take a look at http://www.rptgen.com.

    Thanks
    Myron Joy

  92. Aman says:

    Hi Guys,
    I’m working on RDLC files, I’ve a requirement. I want to display page numbers group wise. For example, if there are 3 Customers having in total 20 pages for the report. For Customer 1, total pages is 5, for Customer 2 total pages is 8 and for Customer 3 total pages is 7. I want while displaying Customer 1 data it should show Page 1 of 5, for Customer 2, it should show Page 1 of 8 and for Customer 3 it should show Page 1 or 7. Please help. Thanks in advance.

  93. Rajaram says:

    Vijay,

    An excellent work which will be very useful for
    developers.
    Thanks a lot.
    Regards Rajaram

  94. Sapphire says:

    Hi Vijay,

    Please can you share your knowledge What I have a problem is How can I adjust the RDLC report width and height depends on screen ? create report dynamically ?

    Thanks and with best regards
    Sapphire

  95. Ammar says:

    How to make RDLC Report from a DYNAMIC Table.
    Here Dynamic Table fields might change and according to that how to create a RDLC C#.net report.
    My Database is SQL Server.
    How to create a RDLS report Dynamically ?

  96. Jayasree says:

    Hi Vijay..

    Good Presentation
    I am working on .rdlc reports. I have a problem with assigning page numbers to pdf.
    The Report is generated for multiple invoices and is converted to Pdf.Now I need to assign page numbers for each invoice not for the whole pdf.

    So if I have 30 invoices in a Pdf then I need to have page numbers assigned to each invoice.

    Thanks in advance
    Jayasree

  97. jof_Phil says:

    Hi Vijay,

    How to print rdlc via client? What i mean is when I deploy my website in our server, then I will print a report in my machine. I CAN’T print. I figure it out that it seems list of printer is on server only.
    I’m using this solution:

    http://msdn.microsoft.com/en-us/library/ms252091%28VS.80%29.aspx

  98. Harisha B K says:

    Hi this is Harisha B K, Working as software engineer in World IT Lab ……. I need step by step Proceedure along with C# Code to generate Dynamic RDLC using report Viewer using SQL Server 2005.

    I tried but i didnt get result. please give me proper code.

    My code is:

    protected void ImgGenerateReport_Click(object sender, ImageClickEventArgs e)
    {
    DataSet result = GenerateDateWiseReport(Convert.ToDateTime(TxtFromDate.Text), Convert.ToDateTime(TxtToDate.Text));
    if (result.Tables[0].Rows.Count > 0)
    {

    //GridView1.DataSource = result;
    //GridView1.DataBind();

    ReportViewer1.LocalReport.DataSources.Clear();

    ReportDataSource reportDSDetail = new ReportDataSource();
    reportDSDetail.Value = result.Tables[0];
    ReportViewer1.LocalReport.DataSources.Add(reportDSDetail);
    ReportViewer1.LocalReport.ReportPath = Request.PhysicalApplicationPath + “Reports\\Report.rdlc”;
    ReportViewer1.DataBind();

    ReportViewer1.LocalReport.Refresh();

    }
    else
    {
    lblMessage.Text = “Sorry, no products under this category!”;

    }

    }

    public DataSet GenerateDateWiseReport(DateTime FromDate, DateTime ToDate)
    {

    SqlConnection sqlCon = new SqlConnection();
    DataSet ds = new DataSet();

    DataTable dt = new DataTable();
    try
    {
    sqlCon.ConnectionString = ConfigurationManager.ConnectionStrings[“Web”].ConnectionString;
    sqlCon.Open();
    SqlCommand cmd = new SqlCommand(“ProcReport”, sqlCon);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.AddWithValue(“@fdate”, FromDate.ToShortDateString());
    cmd.Parameters.AddWithValue(“@tdate”, ToDate.ToShortDateString());
    SqlDataReader rdr = cmd.ExecuteReader();
    dt.Load(rdr);
    ds.Tables.Add(dt);

    }
    catch
    {
    }
    finally
    {
    sqlCon.Close();
    }
    return ds;
    }

    i just want to generate DromDate to ToDate report…. please help me

  99. ravi says:

    Hi Shandilya,
    The Presentation is very good and Clear. Thank you Very much.

    One more concern I have is, I am generating a report in RDLC and Hiding the Duplicate values for a column.
    I am aware that it does not actually solve my problem b`coz, There might be some other transactions with a different ID but having the same value for this column which will also be hidden.

    Coming to the Exact Point, I want to display the repetetive values only once and the duplicate’s for a particular transaction to be displayed as “0” and I want to calculate the Sub total of only those items that were being displayed.

    Please, let me know how I can achieve this using the expression or any other way in RDLC.

    Thanks & Regards,
    Kuchimanchi.

  100. Deepak Tyagi says:

    thanks

  101. Johnb307 says:

    hello!,I like your writing very a lot! proportion we keep in touch more approximately your article on AOL? I require a specialist on this area to unravel my problem. May be that’s you! Looking forward to look you. eecgbebkggge

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: