Quantcast
Viewing all 519 articles
Browse latest View live

Obtain data source name from .rdlc

I'm using ReportViewer in WPF application.

I need to load the data for the report at runtime, as well setting the ReportPath.

So, I need to provide an instance of ReportDataSource to the LocalReport, but I don't know the DataSourceName that the .rdlc uses. And if I don't the right name, the report give me an error:

"A data source instance has not been supplied for the data source 'DataSet1'"

I don't know that the .rdlc needs "DataSet1". How can I obtain this name from .rdlc?

Here's some code:

var reportDataSource = new ReportDataSource("WHAT TO PASS HERE?");
            reportDataSource.Value = data.Tables[0];

            reportViewer.LocalReport.ReportPath = reportPath;
            reportViewer.LocalReport.DataSources.Add(reportDataSource);
            reportViewer.RefreshReport();


Take a look at WPF FlashMessage


external image in rdlc

Hi,

I try to insert external image in RDLC report. I'm using a business object as follow :

  class businessObject
  {
    public string Text { get; set; }
    public int Value { get; set; }
    public Image Piture { get; set; }
    public string PictureLoc { get; set; }

    public businessObject(string text, int val,string pictureLocation)
    {
      Text = text;
      Value = val;
      PictureLoc = pictureLocation;
      Piture = Image.FromFile(PictureLoc);
    }
  }

My report is a simple report displaying on each page the text the value and the picture of each business object. I define on the rdlc an Image object with properties Source=External, Value=Fields!Picture.value, MIMEType=image/png.

 

I inserted a report viewer in my base form and code the form as follow :

  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
      reportViewer1.LocalReport.EnableExternalImages = true;
      for (int i = 1; i < 4; i++) businessObjectBindingSource.Add(new businessObject("Test " + i.ToString(), i, "d:\\Users\\Admin\\Desktop\\Icon\\validate.png"));
      this.reportViewer1.RefreshReport();
    }
  }

But unfortunately when I run the code text and values are well displayed but not the image (little sqare with red cross), any idea why ?

Thanks in advance for your help.

Rgds Pascal.

 

expression

How do i make a expression for # of pages 1 of 1 format?  This is what i am using now [&PageNumber] that just gives me page 1 and i want is: Page1 of 1 and so on.   

Issue regarding crystal report with asp.net 2.0

I am using asp.net2.0 with vb.

I am able to show the report but unable to export or print the report, using the option given in crystal report viewer.

Thanks in advance.

Quick SSRS Hidden Property question

im using SSRS via Visual Studio 2008.

I have an .RDLC and certain rows i want to make invisible based on certain conditions

My Question is if i put the following in the formula field under visibilty ....am I saying that if condition is true then Visibilty is false or am i saying Hidden is false?

=iif(Fields!A.Value =5,  False, True)


Paul Mauriello

Programatically Get & Set the Page Margin, Paper Size, etc... from RDLC ReportViewer Pagesetup dialog

Dear Friends

I am facing a serious problem while Set & Get the Page Margin, Paper Size, Orientation etc to & from the RDLC - Report Viewer Page setup dialog.

I want to do this in Programatically.

Note :

1. Programatically I can able to get the default values of Page Margins from the Pagesetup.

2. Once I change the values in the  Pagesetup, I cannot able to retrieve the modified Pagesetup values, it fetches only the default values of the Pagesetup.

ex., 

Following code gets the default value

MarginTop = ReportViewer1.LocalReport.GetDefaultPageSettings.Margins.Top
MarginLeft = ReportViewer1.LocalReport.GetDefaultPageSettings.Margins.Left
MarginRight = ReportViewer1.LocalReport.GetDefaultPageSettings.Margins.Right
MarginBottom = ReportViewer1.LocalReport.GetDefaultPageSettings.Margins.Bottom

Kindly help me to Get & Set the Pagesetup values Dynamically.


Thanks

Thiraviam

Microsoft Windows sub-report data retrieval fails in VS2012 on a report that worked in VS2010

I wrote a Winforms application about 6 years ago in VS2005. This was migrated to VS2010 and now, to VS2012. It has a Microsoft RDLC report that contains two sub-reports. All has been fine until the recent migration to VS2012. The sub-reports no longer work. I think there may be either a bug or a permissions problem within the RDLC report system itself.

To populate the sub-report data, the LocalReport_SubreportProcessing event has a listener added. Each sub-report fires the event and I check the SubreportProcessingEventArgs.ReportPath. On the development PC, this provides the name of the sub-report, and my code branches to provide the correct dataset in the form of a ReportDataSource added to the sub-report datasources.

When the project is published and installed on various client laptops, the ReportPath name is empty, so my code can no longer branch to add the correct data. Therefore, a data retrieval failed for the sub-report error is displayed in each sub-report.

As a workround, I now add both datasets to each sub-report when the sub-report process event fires. Since each has a different name, the correct data set is accessed and the other is ignored.

Given that the report and sub-reports are built as an embedded resource within the published files, I have no control over how they work. Therefore I assume that there is a permissions issue or some other bug that is causing this, since everthing worked OK in VS2010

ReportViewer inside UpdatePanel not working

Has anyone been able to get the ReportViewer to work correctly inside an UpdatePanel?

For me the report renders fine on the initial whole-page refresh, but when I click the next page button the next page renders but doesn't allow me to navigate through the pages anymore. The toolbar says "(blank) of 0" pages and the arrow toolbar buttons for navigating between pages are all disabled.


Dynamic columns & subtotals in a matrix

I'm writing a report in VS 2005. I've got a matrix with dynamic columns, and I want a subtotal at the end of each row. I've right-clicked on the column group header and selected 'Subtotal', but for some reason it is only showing the amount from the first column in each row, not the total of all values across that row.

The title of the column that is grouped is based on an expression. I want to display only the columns for each month from a chosen time period (the user can choose any time period in a year, eg. Jan - Feb, Jul - Sept, anything). The stored procedure behind the matrix's dataset is functioning correctly. Here's the expression that sets the column title:

=Switch(Fields!lessonMonth.Value=1, "January", Fields!lessonMonth.Value=2, "February", Fields!lessonMonth.Value=3, "March", Fields!lessonMonth.Value=4, "April", Fields!lessonMonth.Value=5, "May", Fields!lessonMonth.Value=6, "June", Fields!lessonMonth.Value=7, "July", Fields!lessonMonth.Value=8, "August", Fields!lessonMonth.Value=9, "September", Fields!lessonMonth.Value=10, "October", Fields!lessonMonth.Value=11, "November", Fields!lessonMonth.Value=12, "December")

 

lessonMonth is a value returned by the stored procedure, and it also has the number of lessons carried out by a teacher for that month. So, an example of the type of data that could be returned is as follows (I choose 2 teachers from a drop-down list, and Jan - Feb as the time period. Teacher 36101 had no lessons in that time period):

Teacher #         Lesson month    Num of lessons

350

1

32

350

2

11

360

1

0

360

2

0



Any help would be great. Thanks

 

Foreach element in reportviewer

Hi all I have a question regarding a foreach statement if possible.

If I have 3 cars for example how do I make 1 report then foreach car fill the report. There could be 1 car or 400 cars but I only want to create 1 table and then loop throught the cars to generate more report without having to create a table for each car.

Hope this makes sense

Jay

How to hide or make invisible a Microsoft Report Viewer subreport using Boolean parameter?

How to hide or make invisible a Microsoft Report Viewer subreport using Boolean parameter?

I have a main report with 4-6 subreports and i want to hide or make invisible subreports using boolean parameter. I m using Microsoft Report Viewer 2010

Displaying Microsoft Project Task’s Notes in SSRS 2008

I have followed this thread to display the TASK_RTF_NOTES in a report.

http://blogs.msdn.com/b/chrisfie/archive/2008/06/04/how-to-display-microsoft-project-task-s-notes-field-in-a-report.aspx

However this  doesn't work and expression gives "n/a" only. To resolve the issue i find this blog

http://www.jasonstrate.com/2010/06/displaying-microsoft-project-tasks-notes-in-ssrs-2008/

The code behind the report is    

‘Instantiate a stringbuilder object
Public s As New System.Text.StringBuilder()

Public Function byteArrayToString(ByVal b() As Byte) As String
Dim i As Integer
dim mystr as string

Try
s.length = 0

For i = 0 To b.Length – 1
If i <> b.Length – 1 Then
s.Append(chr(b(i)))
End If
Next

mystr = left(s.ToString, len(s.ToString)-1)

return ConvertRtfToTextRegex(mystr)
Catch ex as exception
return ex.tostring()
s.length = 0
End Try
End Function

Public Function ConvertRtfToTextRegex(ByVal input As String) As String
Dim returnValue As String = String.Empty
returnValue = System.Text.RegularExpressions.Regex.Replace(input, "\{\*?\\[^{}]+}|[{}]|\\\n?[A-Za-z]+\n?(?:-?\d+)?[ ]?", "")
Return returnValue
End Function

Error:

  • An error occurred during local report processing.
    • The definition of the report 'Report3.rdlc' is invalid.
      • An unexpected error occurred while compiling expressions. Native compiler return value: ‘[BC40000] 'RequestMinimum' is obsolete: 'Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.'.’.

Internet Explorer,optimized for bing and msn

internet explorer displayes 'optimized for bing and msn'

patrick gumbleton


howto fix this problem 

List of Commands for Visual Studio Basic

Is there a website that has all the commands for visual studio basic? Such as- MsgBox, var, Shell, etc.

Reportviewer - report printing different format from display

Hi,

I am using ReportViewer version 9.0 in Visual Studio 2010 and SQL Server 2008 R2.

I generate a matrix report dynamically. I could save the report and then print. If i print the report directly from the print option in the reportviewer window the report format looks different, if there is more data, the row headers are repeated in every page.

Suggestions please.

Thanks in advance.


How To Fix Table Height In Rdlc Report

Hi, I have a window application in which I have used rdlc report for reporting. I gave a sub report in main report(main report contains a header and some fields). Sub report is intended to display table records and there are some main report's fields below the sub report. So the height of the table varies according to the data populated. Then then the fields' position in the main report are getting changed when there is less records gets populated into the table. But my user want's their positions to be unchanged. How to fix the table height in rdlc report irrespective of the records  being populated ? It's an urgent please help.......any body thanks in advance...

2010 ReportViewer and Report Builder 3.0

Hi,

I've created a report using Report Builder 3.0 against a SQL Server 2008 R2 database. The report runs fine and the output is as expected. I saved the report as a RDL file. I then opened Visual Studio 2010 and created a simple Windows application that has a ReportViewer control (10.0.0...). I copied the report to my solution directory and had the report load into the view using the following code:

this.MainReportViewer.ProcessingMode = ProcessingMode.Local;
this.MainReportViewer.LocalReport.LoadReportDefinition( new StreamReader( "RubbishReport.rdl" ) );
this.MainReportViewer.LocalReport.ReportPath = "RubbishReport.rdl";
this.MainReportViewer.RefreshReport();

When I run the application the report viewer displays a message similar to:

An error occurred during local processing. The report definition is not valid. The Report definition has an invalid target namespace. 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition' which cannot be upgraded.

Can someone shed some light on this?

Kind Regards

Michael

 

Problem in Visual studio,css3

Hello. I have a problem in visual studio 2010, css3. I downloaded the  "CSS3 IS 2.1.1" and installed it on windows 8 build 8250. but when i open a css page on visual studio and choose "css3"  from menubar, It does'n do anything and still is "css 2.1". I have removed and installed 2 times and even remove visual studio and installed it again but still isn't work. What should i do???

Expressions

This is my expression that i am trying but with no luck i am wanting is to hide a value on my chart if it is lab test hide.

=First(Fields!ReasonName.Value, "DataSet1")=(lab test.OrElse hide)

How to Set Page Breaks

I have more than 10 pages
And I want to add how this can be done

in report vb.net 2010

thank you

Viewing all 519 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>