Quantcast
Channel: SQL Server Reporting Services
Viewing all 1418 articles
Browse latest View live

Problem in Binding Dynamic Datasets to RDLC file

$
0
0

Dear All,

I am facing problem in binding the dynamic datasets to the RDLC report (report present in my ASP.NET web application).

I am aware of the process of creating the RDL in Business Intelligence SSRS project. But in that case we already know what data that we are going to put into the report.

But in my case, I am not aware of what columns/tables/data that I might get from the Dataset. There is a dynamic sql that will be constructed depending on various business rules and my Job is to bind the data that I get from the dynamic query into a SSRS report.

I am using the below code but when I run the page, the report is showing empty. I have taken a simple query "Select MemberId, PSAID, Name FROM Members" for testing purpose.

ASPX Code :

<div><rsweb:ReportViewer ID="ReportViewer1" runat="server" Height="600px" Width="800px"><LocalReport ReportPath="SampleReport.rdlc" ><DataSources><rsweb:ReportDataSource /></DataSources></LocalReport></rsweb:ReportViewer></div>

ASPX.CS Code:

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DataSet ds = GetDataSet();
                ReportDataSource rds = new ReportDataSource();
                ReportViewer1.Reset();
                rds.Value = ds.Tables[0]; ;
                rds.Name = "MemberTable";
                ReportViewer1.LocalReport.ReportPath = Server.MapPath("SampleReport.rdlc");
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.DataSources.Add(rds);
                ReportViewer1.LocalReport.Refresh();
            }
        }

        private DataSet GetDataSet()
        {

            if (sqlConn.ConnectionString != null && sqlConn.ConnectionString.Trim() != "" && sqlConn.ConnectionString.Trim() != string.Empty)
            {
                sqlConn = (SqlConnection)Session["Connection"];
            }
            else
            {
                da_mgr = new data_access_manager();
                Session["ConnectionString"] = ConfigurationManager.ConnectionStrings["partialConnectString"];
                sqlConn = da_mgr.Connect(Session["ConnectionString"].ToString());
            }

            string sql = "Select MemberId, PSAID, Name FROM Members";

            SqlDataAdapter ad = new SqlDataAdapter(sql, sqlConn);
            DataSet ds = new DataSet();
            ad.Fill(ds,"MemberTable");

            return ds;
        }

I have added a blank RDLC file "SampleReport.rdlc" file into my web project.

All I need is to show the data returned from "Select MemberId, PSAID, Name FROM Members" SQL on the SSRS report.

Please do let me know your thoughts.


Problem with custom assembly and SSRS report subscriptions

$
0
0
<div class="body">

Hi All,

I have SSRS reports that reference a custom assembly called MLI.GB.Navigator.Reporting.Localization.dll.

I have deployed the assembly in C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\bin and modified the config file (rssrvpolicy.config) accordingly.

The assembly works fine in report manager/BIDS but only the report subscription gets this error (i.e. the error comes only in the report subscriptions):

Failed to load expression host assembly. Details: Could not load file or assembly 'MLI.GB.Navigator.Reporting.Localization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Am I missing a configuration setting.

</div>

The request failed with HTTP status 401: Unauthorized

$
0
0

Hello Team,

I am trying to test LogonUser() for my report viewer web application. When i try to connect I encountered this error:

The request failed with HTTP status 401: Unauthorized

Imports System.Web.Services.Protocols
 Imports localhost_reportingService.ReportingService2010
 Imports Microsoft.VisualBasic

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim rs As New localhost_reportingService.ReportingService2010
            Dim UserName As String = TextBox1.Text
            Dim pass As String = TextBox2.Text
            Dim myauthortity As String = Nothing

            rs.LogonUser(UserName, pass, myauthortity)
            Label4.Text = "Authentication Successful"
            ' Response.Redirect("http://www.in.yahoo.com")

        Catch ex As Exception

            Label5.Text = "Error in Authentication"
            Label3.Text = ex.Message.ToString
           ' Response.Redirect("http://www.google.co.in")

Currently I am trying in local machine but not able to connect / validate with 

Please guide me if my approach is correct to check and what changes i need to in :-
a) config file
b) or any other places i am missing :(



Wrap text in Textbox

$
0
0

Hello,

How do I specify the exact size of a text box and if the text is bigger to set it up to be wrapped, to continue in the new line?

C# to change tablix location value on SSRS 2008 r2 report

$
0
0

I am modifying an SSRS 2008 r2 report so users can export the data to excel and sort and filter the data. The only way to accomplsh this task is to remove the report headers. The users will click on a button that says hide 'headers' and click the view button. Then the users will export to excel.

Problem:When the SSRS 2008 R2 report is exported to excel, row one in excel is blank. The column headers and data start on line #2 in excel. I want to remove line #1 from being blank in excel.

To solve this problem, for the tablix that I want to keep, I want to set the location value to 0,0. I do not want to come up with a new report that looks like the original report but the data is shifted. I would prefer to write C# code to solve this problem since I can not find a way to set the SSRS tablix.location property in SSRS.

Thus can you show and/or tell me the following:

1. What C# code can be setup to accomplish my goal? 2. How would you attach the C# code to the SSRS  2008 r2 report for the code to work?

Making Interrupt in SQL server

$
0
0

Hi

In short

I want to do something in asp.net whenever there is a certain change in SQL server database.

I don't know what is the corrent word that describe this process, and for this I named the subject ( Making Interrupt in SQL server )

because this porcess look like the concept of interrupt in oldprogramminglanguages ( likeassembly language or c++ ).

I would be grateful if anyonegave anexample to this process

How to identify start of each page in rdlc? How to avoid blank space if a Row is invisible?

$
0
0

How to identify start of each page in rdlc?

How to avoid blank space if a Row is invisible?

display 0 as -

$
0
0

Hello,

How do I set up the double variable to display 0 as - in Reporting Services?

 


getting error An error occurred during local report processing Export RDLC report to Pdf is not creating in hosting server but working on localhost

$
0
0

i trying to export rdlc into pdf file and print but is not working when am publishing into the server but it is working fine in my developemnet computer

LocalReport report = new LocalReport();
report.ReportPath = System.Web.Configuration.WebConfigurationManager.AppSettings["AccountsReportPath_Report_GeneralLedger"].ToString();
report.DataSources.Add(dtrptsource);
//Export(report);
printPdf(report);

protected void printPdf(LocalReport report)
{
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string extension;

byte[] bytes = report.Render("PDF", null, out mimeType,
out encoding, out extension, out streamids, out warnings);

FileStream fs = new FileStream("e:\\output.pdf", FileMode.Create);
fs.Write(bytes, 0, bytes.Length);
fs.Close();

//Open exsisting pdf
Document document = new Document(PageSize.LETTER);
PdfReader reader = new PdfReader("e:\\output.pdf");
//Getting a instance of new pdf wrtiter
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(
"e:\\Print.pdf", FileMode.Create));
document.Open();
PdfContentByte cb = writer.DirectContent;

int i = 0;
int p = 0;
int n = reader.NumberOfPages;
iTextSharp.text.Rectangle psize = reader.GetPageSize(1);

float width = psize.Width;
float height = psize.Height;

//Add Page to new document
while (i < n)
{
document.NewPage();
p++;
i++;

PdfImportedPage page1 = writer.GetImportedPage(reader, i);
cb.AddTemplate(page1, 0, 0);
}

//Attach javascript to the document
PdfAction jAction = PdfAction.JavaScript("this.print(true);\r", writer);
writer.AddJavaScript(jAction);
document.Close();

//Attach pdf to the iframe
frmPrint.Attributes["src"] = "Print.pdf";
}

Need help with IIF statement

$
0
0

Hello,

I am a newb to SSRS and need some help with an IIF. Can anyone tell me how to achieve this please???

I need to check two date fields, display the first one if it's available, display the second one if the first is not available and if both dates are missing, display a "N/A".

Any assistance appreciated ~ K

ReportViewer throws Excel exceeded row limit expcetion

$
0
0

Hi. I have a report and when I run with a lot of data, exception is  thrown which says that the row limit for excel sheet is exceeded.

Excel Rendering Extension: Number of rows exceeds the maximum possible in a worksheet of this version. Rows requested: 289843. Maximum rows: 65536.

My report structure doesn't allow the page to span more than 150-200 rows per page ( I've set page breaks). From what I understand, the reportviewer creates all the data into one worksheet and after that it split it into multiple worksheets depening on the page breaks. That's the only reasonable think that could be happening.. Anyone has an idea if that is the case or something else ?

(Report viewer) Auto export to Excel

$
0
0

Hi,

Good day,

i am using vb.net.

i would like to auto export the report viewer to Excel format while click a button to insert the data into database MSSQL.

it will auto generate the report viewer to Excel and save it to one location.

Any vb.net coding can do it?

Looking forward to solutions from you all.

Thank you.

 

 

Change page size from A3 to A4

$
0
0

Hello,

I have a report already developed in size A3. I need to change it to A4 size. I have already put all the tables to fit but I still get 4 pages for 1 page. Please help where do I setup the page size and how do I set it correctly?

 

Unable to use ReportViewer.Find() - A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.ReportViewer.WinForms.dll

$
0
0

Hi all,

I am facing a problem which i cannot find word in Report Viewer using ReportViewer.Find(String, Integer). Please refer to the error message below.

A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.ReportViewer.WinForms.dll

Additional information: Operation is not valid due to the current state of the object.

Error

FYI, I have successfully loaded rdl report into localreport in report viewer. I'm able to print, resize and even export the report from report viewer but i fail to find word in reportviewer.

Please help.

Creating a table without a datasource

$
0
0

Is it possible to create a table in a ssrs report without a datasource.

I have a excel document thats needs to be made available via our web app. However the table bit of this document has no need for data from our database, it is all static.

Using Report Builder 3.0 from Sql Server 2008 R2, I drag a table onto the report, click cancel after the datasource selection dialog appears, and type in some text in the table. When I try and run/preview the report, I get the error message: "The tablix‘Tablix1’ is in the report body but the report has no dataset. "

So does this mean that I either have to bind to a 'dummy blank' dataset or drop down tons of text boxs and align them in a table?


Matrix Column Grouping

$
0
0

I have a matrix where the first few columns are not grouped.

However, the final set of columns are grouped on Job Role. This can be 1, 2, 3 or 4.

Some of these columns require no further grouping, however, two columns do.

The problem is that these two columns are to have a different child group to the other.

So, four columns are grouped by Certification Type ID, of which one column is to be further grouped by Course ID and another is to be further grouped by Certification Passed.

Can this be done? Everytime I try and add the second child group, it has a knock on effect on the other columns.

Colour coding in a matrix

$
0
0

I have a matrix with a column group of Job Level, with a child group of Course Type.

There can be up to 4 Job Levels. If the Course Type is Classroom, the colour of the cell(Fill Colour) should be blue. If the Course Type is eLearning, the colour of the cell should be green.

I have put conditional code in for this as follows:

IIF(Fields!CourseType.Value = "Classroom",Blue,Green)

However, if a particular row of data does not have any data for Level 4 for example(Course Type = NULL), then the cell will be Green. This is fine for the eLearning column, but obviously not for the Classroom.

Does anyone know how to get the report to recognise what Course Type the column is grouped on?

 

 

 

 

 

 

call sql reporting in aspx page

$
0
0

hey all

i sucessfully sql report in asp.net using visual stduio 2008 with sql server 2008 r2

i have a report name report1.rdll

now i have a form admin option and i add tab like reports

html

<asp:Panel runat="server" ID="DirectorPanell"><li><a href=""><span>

             Reports ALL Documents

                </span></a></li></asp:Panel>

then any one please tell me how i call sql report ...

how to use rdl file in asp.net

$
0
0

Hi All,

I have designed some charts by using report builder 3.0 [Dashboard.rdl]. Now i want to use the file to my web application's main page. How can i add the file to my web application. I do not have any idea about that. I have searched through internet. I do not get correct solution for this. 

I got something like below,

ReportViewer1.ProcessingMode = ProcessingMode.Local;

 ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report.rdlc");

 Customers dsCustomers = GetData("select top 20 * from customers");

     ReportDataSource datasource = new ReportDataSource("Customers")

BUT, here they are mentioned rdlc file. I have designed .rdl file. Also here, they are providing all datasource and connection string dynamically. But i have designed with directly on ReportBuilder 3.0.  I think, this is for rdlc file which we can create via visual studio. correct?

Also, i got something like below too,
rptViewer.ProcessingMode = ProcessingMode.Remote;

rptViewer.ServerReport.ReportServerUrl =new Uri("https://vvlt38yf7h.reporting.windows.net/reportserver");

rptViewer.ServerReport.ReportPath = "/Report Test/Report_Demo";

rptViewer.ShowParameterPrompts = false;

rptViewer.ShowPrintButton = true;

rptViewer.ShowExportControls = false;

Here, they are calling remote server. I got confused. Do we need to host the .rdl file to separate server? Can not we use the .rdl file in the web application itself?

Please let me know, how to use .rdl file in asp.net website. How to pass the parameter to rdl file from the web page [for ex: Connection string if i need to change the connection string alone].

Thanks in advance,

Sathish

correct version Microsoft.ReportViewer.Common.dll

$
0
0

I wrote a web app with Visual Studio 2008. I'm trying to edit with Visual Studio 2013. The following was not found:

Microsoft.Reporting.WebForms.LocalReport and similar items in code

Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A in web config
Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A in web config

I found the following page  http://msdn.microsoft.com/en-us/library/ms251723%28v=vs.120%29.aspx . I wanted to find a version for 2013 but apparented only 2012 exists. I downloaded ReportViewer.msi and installed. It said I had an older version and asked if I want to update. I said yes.

Upon reopening the web project I assumed I would add report viewer as a reference, but could not find it listed. This is a new windows 7 computer and doesn't have what the XP machine had. I scanned for Microsoft.ReportViewer.Common.dll as mentioned in the web page and found it at C:\Program Files (x86)\Microsoft Visual Studio 10.0\ReportViewer . The date is 06/28/2011. I don't think this is the newest version which should have been installed from ReportViewer.msi which I downloaded.

Can someone comment? Thanks

Viewing all 1418 articles
Browse latest View live


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