Showing posts with label reports. Show all posts
Showing posts with label reports. Show all posts

Wednesday, March 21, 2012

Location of reports?

I cannot find the original copy of a report that is uploaded onto my Report
Server. Where does Reporting Services store the uploaded reports? I need a
physical location so I may copy the .rdl file and edit it.
Is there any other way to copy the report file from inside Reporting
Services?it is in the directory of the report project if you are using VS.NET.
another alternative for the rdl is to select the report properties and
'Update' it (specifying the location of the .rdl - which is what we do for
production here).
Also, you may upload from RM basically anything (it doesn't have to be an
RDL). Let's say for instance that the folder for a department needs a monthly
.XLS for all to work from...
r
"Amon Borland" wrote:
> I cannot find the original copy of a report that is uploaded onto my Report
> Server. Where does Reporting Services store the uploaded reports? I need a
> physical location so I may copy the .rdl file and edit it.
> Is there any other way to copy the report file from inside Reporting
> Services?
>
>|||I was not as complete as I should have been with my answer from post.
if in doubt, look in the ReportServer database (if you used the default name
fom the install) and open the Catalog table. the name and path for the report
are located there.
r
"tutor" wrote:
> it is in the directory of the report project if you are using VS.NET.
> another alternative for the rdl is to select the report properties and
> 'Update' it (specifying the location of the .rdl - which is what we do for
> production here).
> Also, you may upload from RM basically anything (it doesn't have to be an
> RDL). Let's say for instance that the folder for a department needs a monthly
> .XLS for all to work from...
> r
> "Amon Borland" wrote:
> > I cannot find the original copy of a report that is uploaded onto my Report
> > Server. Where does Reporting Services store the uploaded reports? I need a
> > physical location so I may copy the .rdl file and edit it.
> >
> > Is there any other way to copy the report file from inside Reporting
> > Services?
> >
> >
> >|||Amon, the report is stored by RS in the database. It does not exist as a
file. You can use Report Manager to retrieve it (properties of report,
edit).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"tutor" <tutor@.discussions.microsoft.com> wrote in message
news:A431F911-100A-4FCE-852E-D7E2E5CC523E@.microsoft.com...
>I was not as complete as I should have been with my answer from post.
> if in doubt, look in the ReportServer database (if you used the default
> name
> fom the install) and open the Catalog table. the name and path for the
> report
> are located there.
> r
> "tutor" wrote:
>> it is in the directory of the report project if you are using VS.NET.
>> another alternative for the rdl is to select the report properties and
>> 'Update' it (specifying the location of the .rdl - which is what we do
>> for
>> production here).
>> Also, you may upload from RM basically anything (it doesn't have to be an
>> RDL). Let's say for instance that the folder for a department needs a
>> monthly
>> .XLS for all to work from...
>> r
>> "Amon Borland" wrote:
>> > I cannot find the original copy of a report that is uploaded onto my
>> > Report
>> > Server. Where does Reporting Services store the uploaded reports? I
>> > need a
>> > physical location so I may copy the .rdl file and edit it.
>> >
>> > Is there any other way to copy the report file from inside Reporting
>> > Services?
>> >
>> >
>> >sql

Monday, March 19, 2012

LocalReportService2005.ReportingService2005 class?

Last month, on 8/15, in the "Using RDL as a data source for documenting
reports?" thread, Wei Lu posted some sample C# code. I am trying to use it
as a basis for a small app I'm writing, but I can't seem to find the right
library or DLL to use the LocalReportService2005.ReportingService2005 class.
Can someone point me in the right direction?
Thx,
RipleyNever mind. As usual, as soon as I post the question, I find the answer
myself. ;-)
Rip
"Ripley" <ripley@.ihatespam.com> wrote in message
news:%23a2QGBr0GHA.4476@.TK2MSFTNGP05.phx.gbl...
> Last month, on 8/15, in the "Using RDL as a data source for documenting
> reports?" thread, Wei Lu posted some sample C# code. I am trying to use it
> as a basis for a small app I'm writing, but I can't seem to find the right
> library or DLL to use the LocalReportService2005.ReportingService2005
> class.
> Can someone point me in the right direction?
> Thx,
> Ripley
>

LocalReport.Render problem

At the moment my Intranet contains a few reports which are all shown using one reportviewer. I use this bit of code to switch one RDLC for another

===

ReportViewer1.LocalReport.DataSources.Clear();

ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("dsstrafstudie_DataTable1","ObjectDataSource2"));

ReportViewer1.LocalReport.ReportPath = "rptstrafstudie.rdlc";

ObjectDataSource2.FilterExpression = "datum = '" + Request.QueryString["datum"]+ "'";

===

It works just fine ! Now I Want to skip the reportviewer VIEW and just let the people download EXCEL or PDF export. So I add this bit of code

===

Warning[] warnings;

string[] streamids;

string mimeType;

string encoding;

string extension;

byte[] bytes = ReportViewer1.LocalReport.Render("Excel", null, out mimeType, out encoding, out extension, out streamids, out warnings);

FileStream fs = new FileStream(@."c:\output.xls", FileMode.Create);

fs.Write(bytes, 0, bytes.Length);

fs.Close();

===

But I keep getting the error "A data source instance has not been supplied for the data source "dsstrafstudie_DataTable1". Alltough I DO supply a DS instance only a few rules above ? What on earth am I doing wrong?

Thx in advance,

Puitje

Hi Puitje,

Did you find a solution for this error? I am experiencing the exact problem.

Thanks

|||Instead of using "ReportViewer1.LocalReport" create a new instance of a LocalReport and use that one.|||

I use a new variable LocalReport rp1, but error doesn't change ...

If i didin't use a datasource for the report the code works correctly.

Someone have any idea ?

Thanks

|||Did you add the datasource when you used Render?|||

Yes cause i copy the same code that visualize the Report correctly and i put it in a new function.

The function who render at video works correctly, the function who render manually give me the exception.

|||Are you sure that the objectdatasource you provided is correctly populated? Maybe you lost some event that populates it?|||I

I post the code :


these two function are called on Page_Load event ( the same on Page_PreRender).

The first function works correctly and display on my page the report with correct data.

The second function generate an exception on Render call.

He didn't find "DataforReport" istance.

The rdlc is a converted rdl.

FIRST

virtual public Boolean VisualizzaReport(ref Hashtable par)
{
ReportViewer rp1;
ReportDataSource ds1;
SqlDataSource sql1;
Database dbRep;
ControlParameter cp1;
Label l1;

// Definisce l'SqlDataSource per poi definire il ReportDataSource in funzione di questo
sql1 = new SqlDataSource();
sql1.ID = ReportPage.PageContent.SqlReportSource.ToString();
dbRep = new Database(this.NomeDatabase, this.NomeSP, ref sql1, 0);
sql1.SelectParameters.Clear();

foreach (DictionaryEntry de in par)
{
l1 = new Label();
l1.ID = "Label_"+de.Key.ToString();
l1.Text=de.Value.ToString();
l1.Visible = false;
this.content.Controls.Add(l1);

cp1 = new ControlParameter();
cp1.ControlID = l1.ID = "Label_" + de.Key.ToString();
cp1.Name = de.Key.ToString();
cp1.PropertyName = "Text";
cp1.Type = Type.GetTypeCode(de.Value.GetType());
// TypeCode.Int32;
sql1.SelectParameters.Add(cp1);
}
this.content.Controls.Add(sql1);
// Definisce il reportDataSource
ds1 = new ReportDataSource();
ds1.Name = "DataforReport";
ds1.DataSourceId = ReportPage.PageContent.SqlReportSource.ToString();

// Definisce il Report
rp1 = new ReportViewer();
rp1.ID = ReportPage.PageContent.ReportLocale.ToString();
rp1.ShowToolBar = false;
rp1.Width = new Unit(100, UnitType.Percentage); ;
rp1.Height = new Unit(100, UnitType.Percentage); ;
//rp1.ID = ReportPage.PageContent.ReportLocale.ToString();
rp1.LocalReport.DisplayName = this.NomeReport;
rp1.LocalReport.ReportPath = this.NomefileReport;
rp1.LocalReport.DataSources.Clear();
rp1.LocalReport.DataSources.Add(ds1);
rp1.LocalReport.Refresh();
this.content.Controls.Add(rp1);

return true;
}

SECOND

virtual public Boolean RenderReport(ref Hashtable par)
{
ReportViewer rp1;
ReportDataSource ds1;
SqlDataSource sql1;
Database dbRep;
ControlParameter cp1;
Label l1;

sql1 = new SqlDataSource();
sql1.ID = ReportPage.PageContent.SqlReportSource.ToString();
dbRep = new Database(this.NomeDatabase, this.NomeSP, ref sql1, 0);
sql1.SelectParameters.Clear();

foreach (DictionaryEntry de in par)
{
l1 = new Label();
l1.ID = "Label_" + de.Key.ToString();
l1.Text = de.Value.ToString();
l1.Visible = false;
this.content.Controls.Add(l1);

cp1 = new ControlParameter();
cp1.ControlID = l1.ID = "Label_" + de.Key.ToString();
cp1.Name = de.Key.ToString();
cp1.PropertyName = "Text";
cp1.Type = Type.GetTypeCode(de.Value.GetType());
// TypeCode.Int32;
sql1.SelectParameters.Add(cp1);
}
this.content.Controls.Add(sql1);
// Definisce il reportDataSource
ds1 = new ReportDataSource();
ds1.Name = "DataforReport" ;
ds1.DataSourceId = ReportPage.PageContent.SqlReportSource.ToString();

ReportViewer rp2;
rp2 = new ReportViewer();
rp2.LocalReport.ReportPath = "Fattura.rdlc";
rp2.LocalReport.DataSources.Clear();
rp2.LocalReport.DataSources.Add(ds1);
string deviceInfo =

"<DeviceInfo>" +

" <OutputFormat>PDF</OutputFormat>" +

" <PageWidth>8.5in</PageWidth>" +

" <PageHeight>11in</PageHeight>" +

" <MarginTop>0.5in</MarginTop>" +

" <MarginLeft>1in</MarginLeft>" +

" <MarginRight>1in</MarginRight>" +

" <MarginBottom>0.5in</MarginBottom>" +

"</DeviceInfo>";
byte[] data =rp2.LocalReport.Render("PDF", deviceInfo, out mimeType,out encoding, out extension, out streamids, out warnings);
FileStream fs = new FileStream(@."c:\prova.pdf", FileMode.Create);
fs.Write(data, 0, data.Length);
fs.Close();
//determine if format is rendered to the web or a file.

return true;
}

|||Why do you define 2 datasources? When do you add data to ds1?|||I think the refresh method in the first code triggers the datasource updating...

Monday, March 12, 2012

Localizing Labels

Hi,

I am working on localizing SSRS reports and wanted to store the text for the labels in the database for different languages. The Language id would be passed by the user as a parameter. Based on this Language ID, the required data for the labels would be fetched and stored in a dataset in the custom code. This dataset would then be searched for relevant LabelIDs and the label caption in the particular language would be returned. The dataset would be a shared variable so it would get initialized the first time. For initializing the dataset I would need the datasource information, which would either be stored in the Shared Data source or embedded in the Report.

Can I refer to the shared data source being used by the current report in the Custom Code Window ? Or can I retrieve the data source information embedded in the report and use it in the Custom Code? If so, how ?

Thanks In Advance.

Ashish

Hi Guys,

Does any one know as to how can we access the data source connection information from Custom Code ?

I need that information to populate a custom dataset created in the Custom Code.

Please help.

TIA.

Ashish

Localize Report

I've read several places that there isn't a way to localize reports at run
time of a report, so I wanted to ask what is the "best practice" of deploying
the reports if you have some clients that might want to view 'English'
reports and others who might want to view 'German' reports. I'd like to
avoid having duplicate reports, but it really sounds like this is my only
option.
Any ideas you have or suggestions of articles to read on the topic would be
greatly appreciated!
DanYou could put all of the formatting and vocabulary in functions, and vary
them based on a parameter, using =Iif(...) or =Switch(...)
With this approach, or with a duplicate report approach, you could adopt an
automated search/replace process to go through the RDL file and alter it to
support multiple languages.
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Dan" <Dan@.discussions.microsoft.com> wrote in message
news:1666568A-5499-4452-8132-B9BEE7893157@.microsoft.com...
> I've read several places that there isn't a way to localize reports at run
> time of a report, so I wanted to ask what is the "best practice" of
> deploying
> the reports if you have some clients that might want to view 'English'
> reports and others who might want to view 'German' reports. I'd like to
> avoid having duplicate reports, but it really sounds like this is my only
> option.
> Any ideas you have or suggestions of articles to read on the topic would
> be
> greatly appreciated!
> Dan

Localization of Reports

Are there any plans to improve the process of localizing reports? for example, it would be nice to extend the RDL schema to include a section for resource strings and localization information.

Thanks

This is very high on our wish list. Unfortunately, it will most likely not make it in Katmai.

|||

Hi Brian,

Sorry to hear that we won't see this functionality in Katmai. Should we start a campaign and try to get it into Katmai J?

Given we have to deal with this reality for a while, what is the best approach to localize reports. We know about the recommendation in http://msdn2.microsoft.com/en-us/library/ms156493.aspx and http://technet.microsoft.com/en-us/library/aa964130.aspx.

We have 100’s of reports and we don’t want to make sacrifice performance, if possible.

Thanks

Localization of reports

Hi,
We are currently working on a project where we need to deploy some reports
(Reporting Services 2005) in a multi language environment, but we struggling
to find out how to localize reports in reporting services.
1) How do I localize report texts? I can see that there's language
property and a ValueLocId property? Should I use these and how?
2) How do I localize report parameter prompts?
3) How do I localize reportname and description? For the description I
can see that there's a DescriptionLocId?
Are there any good resources on how to localize reports in Reporting
Services 2005?
Kind Regards
HenrikDuplicate, please se my other post.
"Henrik Skak Pedersen" <skak@.community.nospam> wrote in message
news:u%23H8N9x5GHA.4112@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We are currently working on a project where we need to deploy some reports
> (Reporting Services 2005) in a multi language environment, but we
> struggling
> to find out how to localize reports in reporting services.
> 1) How do I localize report texts? I can see that there's language
> property and a ValueLocId property? Should I use these and how?
> 2) How do I localize report parameter prompts?
> 3) How do I localize reportname and description? For the description
> I
> can see that there's a DescriptionLocId?
> Are there any good resources on how to localize reports in Reporting
> Services 2005?
> Kind Regards
> Henrik
>

Localization

Hi,
We are currently working on a project where we need to deploy some reports
(Reporting Services 2005) in a multi language environment, but we struggling
to find out how to localize reports in reporting services.
1) How do I localize report texts? I can see that there's language
property and a ValueLocId property? Should I use these and how?
2) How do I localize report parameter prompts?
3) How do I localize reportname and description? For the description I
can see that there's a DescriptionLocId?
Are there any good resources on how to localize reports in Reporting
Services 2005?
Kind Regards
HenrikHello Henrik,
As for the Reporting Service 2005, it does support some localization
features, they include:
1)the localization of the built-in UI components, such as SSRS's
htmlviewer, report designer
2) some simple localization on the SSRS report's data
For 1), the SSRS has done the work for us already, for example, when we
visit the html report, the UI elements on the htmlviewer(button or other UI
element's text) will render the localized representation according to
client-side browser's user-language setting.
For 2), if we want to do some simple localization on the static data/text
displayed on our report, we can dynamically format them according to the
"User!Language" parameter in our report expression. Or you can even build
custom assembly that has custom code logic to generate localizaed text(from
net resource ) accordin to this parameter.
You can find all the localization support of SSRS 2005 in the BOL:
#International Considerations for Reporting Services
http://msdn2.microsoft.com/en-us/library/ms156493.aspx
Therefore, for your scenario and the questions you mentioned, my
understanding is:
1) How do I localize report texts? I can see that there's language
property and a ValueLocId property? Should I use these and how?
========================================These properties is mainly used to specify a fixed culture/locale for
text/data formatting. Our report expression's output will be affected by
these setting.
I'm wondering whether you also want to localize the data which will be
displayed on report(retrieved from datasource). If this is the case, I'm
afraid those settings can not help on this because the data is already
retrieved by data processing engine before rendering, and rendering engine
can not translate text on the fly. For report which has data dedicated to
different languages/cultures, it is recommended that we build multiple
reports for each culture/language respectively.
2) How do I localize report parameter prompts?
========================================I think the report parameter prompts is a part of the built-in report
htmlviewer which will render localized UI according to client browser's
language setting.
3) How do I localize reportname and description? For the description I
can see that there's a DescriptionLocId?
=========================================I think such LOCID is also mainly used for some date/time number formatting
, and can not help on text/data localized formatting. For displaying
multiple language specific reports, I would suggest create multiple reports
for each language(use the corresponding datasource from database) as
mentioned in #1.
Please feel freee to let me know if you have any questions or other
consideration on this.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hello Henrik,
How are you doing on this issue? I've just discussed with some other
engineers from reporting service team and they have help confirm that the
"LocId" of reportItem or the report is still an unsupported feature that
teams the SSRS runtime which generate report will ignore such properties on
each reportItem.
The only usage of this LocID property is that we can use this property to
do some static localization related transformation on the RDL file. For
example, we can use XSLT to transform the RDL into another RDL xml form and
use the "LocID" to reference certain elements in the RDL when performing
XSLT transforming.
Currently , for SSRS report localization, I've mentioned the most common
approaches in my last reply. Please feel free to let me know if you have
any further questions on this.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi all,
I'm working with local reports (rdlc) and what I'm trying to do is to
localize the static text (column headers), not displayed data.
I have my column headers in textboxes which have the 'ValueLocID'
property, but I can't figure out how to make it work.
Is it possible to accomplish what I want with a single rdlc file? (not
as many as languages)
Could somebody point me out to the right direction?
TIA,
Sebastian
On Oct 9, 7:05 am, stch...@.online.microsoft.com (Steven Cheng[MSFT])
wrote:
> Hello Henrik,
> How are you doing on this issue? I've just discussed with some other
> engineers from reporting service team and they have help confirm that the
> "LocId" of reportItem or the report is still an unsupported feature that
> teams the SSRS runtime which generate report will ignore such properties on
> each reportItem.
> The only usage of this LocID property is that we can use this property to
> do some static localization related transformation on the RDL file. For
> example, we can use XSLT to transform the RDL into another RDL xml form and
> use the "LocID" to reference certain elements in the RDL when performing
> XSLT transforming.
> Currently , for SSRS report localization, I've mentioned the most common
> approaches in my last reply. Please feel free to let me know if you have
> any further questions on this.
> Sincerely,
> Steven Cheng
> Microsoft MSDN Online Support Lead
> This posting is provided "AS IS" with no warranties, and confers no rights.

Localisation bug?

Can you tell me if this is a bug?
My browser language (Internet Explorer version 6) is set to English (United
Kingdom) [en-gb].
I have 2 reports based on the AdventureWorks2000 database.
The first report is:
SELECT PurchaseOrderID, EmployeeID, OrderDate
FROM PurchaseOrderHeader
WHERE EmployeeID = @.EmployeeID
ORDER BY OrderDate DESC
The second report is:
SELECT PurchaseOrderID, EmployeeID, OrderDate
FROM PurchaseOrderHeader
WHERE EmployeeID = @.EmployeeID AND OrderDate = @.OrderDate
I have created an ACTION link (using "Jump to Report") from the first report
to the second report which sets the parameters(@.EmployeeID & @.OrderDate)
accordingly. (ie. @.EmployeeID = Fields!EmployeeID.Value; @.OrderDate = Fields!OrderDate.Value. @.EmployeeID is type integer; @.OrderDate is type
DateTime).
Everything works as expected unless I perform the following steps:
1. Run the Report1 (deployed version) [report displays succesfully]
2. Click on the action link to jump to Report2 [report displays succesfully]
3. Click the "refresh" toolbar button (not Internet Explorer Refresh)
[ERROR!!]
The Error is:
Reporting Services Error
---
The value provided for the report parameter 'OrderDate' is not valid for
its type. (rsReportParameterTypeMismatch) Get Online Help
---
Notes:
--
1. If I run Report2 independantly, the refresh button works.
2. Everything works from VS.Net "preview" tab. It is only when deployed
that the error occurs.
3. If I set my Internet Explorer language to English(United States) [en-us]
then the error goes away!
Is this a bug?
Cheers,
JoeI've found a workaround (on this newsgroup) for this bug but it's not ideal:
Instead of using the 'Jump to Report' action you can use the 'Jump to URL'
action and specify the language setting there as follows:
=Globals!ReportServerUrl & "?/Development1/PODetail&EmployeeID=" &
Parameters!EmployeeID.Value & "&OrderDate=" & Fields!OrderDate.Value &
"&rs:ParameterLanguage=en-GB"
... and hey presto it works!
"Joe" wrote:
> Can you tell me if this is a bug?
> My browser language (Internet Explorer version 6) is set to English (United
> Kingdom) [en-gb].
> I have 2 reports based on the AdventureWorks2000 database.
> The first report is:
> SELECT PurchaseOrderID, EmployeeID, OrderDate
> FROM PurchaseOrderHeader
> WHERE EmployeeID = @.EmployeeID
> ORDER BY OrderDate DESC
> The second report is:
> SELECT PurchaseOrderID, EmployeeID, OrderDate
> FROM PurchaseOrderHeader
> WHERE EmployeeID = @.EmployeeID AND OrderDate = @.OrderDate
> I have created an ACTION link (using "Jump to Report") from the first report
> to the second report which sets the parameters(@.EmployeeID & @.OrderDate)
> accordingly. (ie. @.EmployeeID = Fields!EmployeeID.Value; @.OrderDate => Fields!OrderDate.Value. @.EmployeeID is type integer; @.OrderDate is type
> DateTime).
>
> Everything works as expected unless I perform the following steps:
> 1. Run the Report1 (deployed version) [report displays succesfully]
> 2. Click on the action link to jump to Report2 [report displays succesfully]
> 3. Click the "refresh" toolbar button (not Internet Explorer Refresh)
> [ERROR!!]
>
> The Error is:
> Reporting Services Error
> ---
> The value provided for the report parameter 'OrderDate' is not valid for
> its type. (rsReportParameterTypeMismatch) Get Online Help
> ---
>
> Notes:
> --
> 1. If I run Report2 independantly, the refresh button works.
> 2. Everything works from VS.Net "preview" tab. It is only when deployed
> that the error occurs.
> 3. If I set my Internet Explorer language to English(United States) [en-us]
> then the error goes away!
>
> Is this a bug?
>
> Cheers,
> Joe
>

localhost/reports not found

Everything works ok at work and so I decided to install it at home on Windows 2003.

For some odd reason I can run my report this way:

http://localhost/ReportServer?%2fReport+Project1%2fReportFirstTest&rs:Command=Render

But if I try this..

http://localhost/reports

all I get is "The page cannot be found"

I can also get to the report by clicking on links found on the page I get usinghttp://localhost/ReportServer

I'd guess an IIS setting got messed up somehow, anyone know?

1. Make sure that Home.aspx is a default webpage for the related web site in the IIS, or try thishttp://localhost/reports/home.aspx ; 2. Make sure that the asp.net 2.0 version is selected for this web site; 3. It's better to have an own pool for asp.net 2.0 applications in the win 2003.

Friday, March 9, 2012

Locale not supported Error

I am using Vista and when I try to open one of the Business intelligence reports, I get error "Locale 16393 not supported". Any clue on this ?

Thanks

moving to SQL Reporting Services forum.

Locale and Culture

As I am developing reports to be used in severel different languages I would like to start a discussion about locales and cultures.

Hope to find answers to very simple questions like whats the difference between locale and culture and what determines the language used by the reporting service and the preview in visual studio.

Please share your expirence .

You may want to read this: http://msdn2.microsoft.com/en-us/library/ms156493.aspx

-- Robert

Wednesday, March 7, 2012

Local ReportViewer - Printing margins off by ~1/8 inch

I am printing my reports from my local report viewr, and the margins are
off by 1/8 inch if I include a header. It looks like printing shifts the
contents of the report 1/8 inch to the right, borking everything.
1. Report has a "header" area. Without this header, the printing is fine.
2. Report body is 7" wide
3. Margins are .75" (6/8) inch on all sides
4. Print Preview mode displays the report properly, centered
5. Output is similarly skewed on all printers (tried 4)
6. This is using the VS SP1 version of the RS dll's.
Setting the margins to Left: 0.625, Right: 0.875 (5/8&7/8) actually causes
it to print centered, so I know it is paying attention. When I do this, the
print layout mode shows the contents shifted to the left 1/8", as expected.
I assume that people print using this control, or at least it was tested,
so has anyone else seen this or is it a confirmed bug?
Thanks,
// Andrew Backer
P.S. In a related bug, if I include the header then the local viewer __insists__
on rendering the page at 8.5 inches wide, regardless of the fact that the
body is still 7". This doesn't seem to affect printing, but without the
header it only renders at the body width, 7", rather than giving me 1.5"
of blank spaceCheck the "Spacing" property under the Layout Tab of the Report Properties
window.
Set it to "0in".

Local reports with ADO.NET Dataset help

I'm trying to use a local report in a Windows Forms application that
uses an ado.net dataset. The trouble is that I'm trying to figure out
how to access data within related tables. If the dataset has a table
called Customers with two records in it, how do I go about displaying
the data from a particular customer in a particular place? Can I choose
the row to show based upon a key in a separate table? That would be
ideal. Any ideas? I've searched and found no answers.
Thanks,
BrianHi Brian, I'm running with the same problem.
For some reason all I see it's one of the DataTable's data...
have you figured this out yet?
Best regards,
Sebasti=E1n
On Oct 26, 8:18 pm, Brian Vallelunga <brian.vallelu...@.gmail.com>
wrote:
> I'm trying to use alocalreport in a Windows Forms application that
> uses an ado.netdataset. The trouble is that I'm trying to figure out
> how to access data within related tables. If the dataset has a table
> called Customers with two records in it, how do I go about displaying
> the data from a particular customer in a particular place? Can I choose
> the row to show based upon a key in a separate table? That would be
> ideal. Any ideas? I've searched and found no answers.
> > Thanks,
> > Brian|||I started to look into local reports and decided it was a pain for this very
reason. However, I do know what you need to do conceptually. Nothing has
changed as far as how to solve the problem in the design of the reports. A
server report can be turned into a local report (you just rename the rdl
file to rdlc). Indeed, my suggestion on how to develop is to develop inside
the report designer (even if no server you can design and preview). Then
once working bring it into you app.
Now, in RS the way you handle master detail is by sub reports. That has not
changed. For local reports you have to do the same thing. You have to tie
into an event in the sub report to take the parameter and give the sub
report the appropriate data. So, let's say that you have a dataset all
populated. The main report is tied to the data table for the master. Then
you have the sub report and you tie the subreport parameter to a field of
the master table record. In the event you then would need to filter the
appropriate data table and set the source of the subreport to that. Note
that this event will be called for each record in the master.
Hope this helps at least conceptually on what you need to do.
After seeing all the hoops I would have to go through, I decided to stay
with server based reports.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<sebastiangomezcorrea@.gmail.com> wrote in message
news:1162385028.994774.52040@.k70g2000cwa.googlegroups.com...
Hi Brian, I'm running with the same problem.
For some reason all I see it's one of the DataTable's data...
have you figured this out yet?
Best regards,
Sebastián
On Oct 26, 8:18 pm, Brian Vallelunga <brian.vallelu...@.gmail.com>
wrote:
> I'm trying to use alocalreport in a Windows Forms application that
> uses an ado.netdataset. The trouble is that I'm trying to figure out
> how to access data within related tables. If the dataset has a table
> called Customers with two records in it, how do I go about displaying
> the data from a particular customer in a particular place? Can I choose
> the row to show based upon a key in a separate table? That would be
> ideal. Any ideas? I've searched and found no answers.
> Thanks,
> Brian|||Hey Bruce, thanks for the reply.
Even though I'm working with local reports, I have to ask... how do you
do what I'm trying with rdl reports? Is there some kind of wizzard or
something?
TIA
On Nov 1, 12:08 pm, "Bruce L-C [MVP]" <bruce_lcNOS...@.hotmail.com>
wrote:
> I started to look into local reports and decided it was a pain for this v=ery
> reason. However, I do know what you need to do conceptually. Nothing has
> changed as far as how to solve the problem in the design of the reports. A
> server report can be turned into a local report (you just rename the rdl
> file to rdlc). Indeed, my suggestion on how to develop is to develop insi=de
> the report designer (even if no server you can design and preview). Then
> once working bring it into you app.
> Now, in RS the way you handle master detail is by sub reports. That has n=ot
> changed. For local reports you have to do the same thing. You have to tie
> into an event in the sub report to take the parameter and give the sub
> report the appropriate data. So, let's say that you have a dataset all
> populated. The main report is tied to the data table for the master. Then
> you have the sub report and you tie the subreport parameter to a field of
> the master table record. In the event you then would need to filter the
> appropriate data table and set the source of the subreport to that. Note
> that this event will be called for each record in the master.
> Hope this helps at least conceptually on what you need to do.
> After seeing all the hoops I would have to go through, I decided to stay
> with server based reports.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> <sebastiangomezcor...@.gmail.com> wrote in messagenews:1162385028.994774.5=2040@.k70g2000cwa.googlegroups.com...
> Hi Brian, I'm running with the same problem.
> For some reason all I see it's one of the DataTable's data...
> have you figured this out yet?
> Best regards,
> Sebasti=E1n
> On Oct 26, 8:18 pm, Brian Vallelunga <brian.vallelu...@.gmail.com>
> wrote:
>
> > I'm trying to use alocalreport in a Windows Forms application that
> > uses an ado.netdataset. The trouble is that I'm trying to figure out
> > how to access data within related tables. If the dataset has a table
> > called Customers with two records in it, how do I go about displaying
> > the data from a particular customer in a particular place? Can I choose
> > the row to show based upon a key in a separate table? That would be
> > ideal. Any ideas? I've searched and found no answers.
> > > Thanks,
> > > Brian- Hide quoted text -- Show quoted text -

Local reports !

I have been working with server reports in the past now I am working on local
reports and it apears as iif many things are different!
For one, I cant get report parameters to show up in the report viewer is
that normal for local reports?
Additionally the "report parameters" screen for me is different then
anything in my book and it apears as if there is no way to actually link a
report parameter to any field!
Do I need to look for some educational resource that just apply to .rdlc?I think I found A answer to my question.
On local report for web apps the objectdatasource becomes your parameter
control device and then I can use my own asp.net controls to filter on those
parameters.
I think I am missing something from a local report perspective but changing
my focus from the report and to the objectdatasource I think will solve my
issue.
"sean_mcad" wrote:
> I have been working with server reports in the past now I am working on local
> reports and it apears as iif many things are different!
> For one, I cant get report parameters to show up in the report viewer is
> that normal for local reports?
> Additionally the "report parameters" screen for me is different then
> anything in my book and it apears as if there is no way to actually link a
> report parameter to any field!
> Do I need to look for some educational resource that just apply to .rdlc?

Local Reports

Thanks for the info but I am interested in designing and running local reports in a windows form. I have not been able to find correct documentation on how you define a schema that can be used to create an rdlc file for design of a report that uses a datasource that is set at runtime. Specifically, I would like to use business objects that return a data table in a get method.

The online documentation is incomplete and full of errors.The easiest way is simply to add a report to a your project from VS2005. It creates a .rdlc file. Then you can use the inline designer to build your report. I have not tried doing it from business objects (so far only inline sql statements and datasets), if you figure this out, please let me know. Many of my projects are built on Rocky Lhotka's CSLA.net.|||

I'd like to know how to create a report from ADO datasets. If you have code that works, please post here.

I have figured out how to do the business object report. Follow all of the instructions in this walkthrough:
http://msdn2.microsoft.com/en-us/library/ms251784#

However the last instruction for the form load of the report viewer form is wrong. You will need to replace the following:

this.ProductBindingSource.DataSource = m_merchant.GetProducts();

WITH:

reportViewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;

reportViewer.LocalReport.ReportPath = @."C:\<your path>\Report1.rdlc";

reportViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("<your namespace>_Product", m_merchant.GetProducts()));

|||

this.ProductBindingSource.DataSource = m_merchant.GetProducts()

This last instruction is not actually wrong. I thought the same thing since I did not understand where "ProductBindingSource" came from, but I later realized that it is the name of the Binding Source Instance.

In order to find this, open up the smart tags panel in the top right hand corner of the report viewer control, select "Choose Data Source" and there you will see the instance name for the appropriate data source. Simply replace "ProductBindingSource" in this.ProductBindingSource.DataSource = m_merchant.GetProducts() with the name of the instance.

Local Reports

Thanks for the info but I am interested in designing and running local reports in a windows form. I have not been able to find correct documentation on how you define a schema that can be used to create an rdlc file for design of a report that uses a datasource that is set at runtime. Specifically, I would like to use business objects that return a data table in a get method.

The online documentation is incomplete and full of errors.The easiest way is simply to add a report to a your project from VS2005. It creates a .rdlc file. Then you can use the inline designer to build your report. I have not tried doing it from business objects (so far only inline sql statements and datasets), if you figure this out, please let me know. Many of my projects are built on Rocky Lhotka's CSLA.net.|||

I'd like to know how to create a report from ADO datasets. If you have code that works, please post here.

I have figured out how to do the business object report. Follow all of the instructions in this walkthrough:
http://msdn2.microsoft.com/en-us/library/ms251784#

However the last instruction for the form load of the report viewer form is wrong. You will need to replace the following:

this.ProductBindingSource.DataSource = m_merchant.GetProducts();

WITH:

reportViewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;

reportViewer.LocalReport.ReportPath = @."C:\<your path>\Report1.rdlc";

reportViewer.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("<your namespace>_Product", m_merchant.GetProducts()));

|||

this.ProductBindingSource.DataSource = m_merchant.GetProducts()

This last instruction is not actually wrong. I thought the same thing since I did not understand where "ProductBindingSource" came from, but I later realized that it is the name of the Binding Source Instance.

In order to find this, open up the smart tags panel in the top right hand corner of the report viewer control, select "Choose Data Source" and there you will see the instance name for the appropriate data source. Simply replace "ProductBindingSource" in this.ProductBindingSource.DataSource = m_merchant.GetProducts() with the name of the instance.

Local report from local dataset

Hi,
I have some experience with RS 2000, but just started 2005.
I am trying to incorporate reports into my application using report viewer,
no server.
I will report from the data set that I created inside of my app. It is also
possible that based on user's input some fields can be suppressed.
I know that I can use business objects, but it looks like I have everything
in my data set. So, can I build my report(s) from this data set in design
time (how can I see my data set as data source?)?
And another question, is there any API to manipulate controls on report
during design time? I spent a lot of time with Crystal - I can do this there.
I hope RS has something like this or even better.
Thanks.Something like the code below. What APIs do you need at design time?
' Load the dataset
adapter.Fill(dataset)
' Local report
reportViewer.ProcessingMode = ProcessingMode.Local
reportViewer.LocalReport.EnableHyperlinks = True
' Set RDL file
reportViewer.LocalReport.ReportPath = "Sales Forecast.rdlc"
' Supply a DataTable for the report data source
reportViewer.LocalReport.DataSources.Add(New
ReportDataSource("SalesForecast_Table", dataset.Tables(0)))
' Set the report parameters. Notice that the parameters array is 0-based,
hence (1) for two parameters
Dim parameters(1) As ReportParameter
parameters(0) = New ReportParameter("Year", 2003)
parameters(1) = New ReportParameter("NumberMonths", 3)
reportViewer.LocalReport.SetParameters(parameters)
reportViewer.RefreshReport()
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"Victor" <Victor@.discussions.microsoft.com> wrote in message
news:BA5E4C4F-A866-4929-9E30-07552EDF687E@.microsoft.com...
> Hi,
> I have some experience with RS 2000, but just started 2005.
> I am trying to incorporate reports into my application using report
> viewer,
> no server.
> I will report from the data set that I created inside of my app. It is
> also
> possible that based on user's input some fields can be suppressed.
> I know that I can use business objects, but it looks like I have
> everything
> in my data set. So, can I build my report(s) from this data set in design
> time (how can I see my data set as data source?)?
> And another question, is there any API to manipulate controls on report
> during design time? I spent a lot of time with Crystal - I can do this
> there.
> I hope RS has something like this or even better.
> Thanks.|||Thank you Teo,
API to hide/show/change/etc. fields or any items. Probably it can be done by
manipulating XML file .rdlc, but is there any API for this already?
Also, can I build my own dataset and then based on it build my report,
during design time and during run time?
And Teo, are you going to write another book on SSRS, but now based on 2005?
Thanks.
"Teo Lachev [MVP]" wrote:
> Something like the code below. What APIs do you need at design time?
> ' Load the dataset
> adapter.Fill(dataset)
> ' Local report
> reportViewer.ProcessingMode = ProcessingMode.Local
> reportViewer.LocalReport.EnableHyperlinks = True
> ' Set RDL file
> reportViewer.LocalReport.ReportPath = "Sales Forecast.rdlc"
> ' Supply a DataTable for the report data source
> reportViewer.LocalReport.DataSources.Add(New
> ReportDataSource("SalesForecast_Table", dataset.Tables(0)))
> ' Set the report parameters. Notice that the parameters array is 0-based,
> hence (1) for two parameters
> Dim parameters(1) As ReportParameter
> parameters(0) = New ReportParameter("Year", 2003)
> parameters(1) = New ReportParameter("NumberMonths", 3)
> reportViewer.LocalReport.SetParameters(parameters)
> reportViewer.RefreshReport()
>
> --
> HTH,
> ---
> Teo Lachev, MVP, MCSD, MCT
> "Microsoft Reporting Services in Action"
> "Applied Microsoft Analysis Services 2005"
> Home page and blog: http://www.prologika.com/
> ---
> "Victor" <Victor@.discussions.microsoft.com> wrote in message
> news:BA5E4C4F-A866-4929-9E30-07552EDF687E@.microsoft.com...
> > Hi,
> > I have some experience with RS 2000, but just started 2005.
> > I am trying to incorporate reports into my application using report
> > viewer,
> > no server.
> > I will report from the data set that I created inside of my app. It is
> > also
> > possible that based on user's input some fields can be suppressed.
> >
> > I know that I can use business objects, but it looks like I have
> > everything
> > in my data set. So, can I build my report(s) from this data set in design
> > time (how can I see my data set as data source?)?
> >
> > And another question, is there any API to manipulate controls on report
> > during design time? I spent a lot of time with Crystal - I can do this
> > there.
> > I hope RS has something like this or even better.
> >
> > Thanks.
>
>|||The APIs are XML DOM. since RDL is XML-based. If you have too much
manipulation to do, consider buiding an object model on top of it. That's
what I am doing for my currect project. Yes, you can use VS.NET 2005 to
design your report.
About the book...I decided to skip 2005. The new one is about SSAS 2005 and
BI (http://www.prologika.com/Books/0976635305/Book.aspx)
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"Victor" <Victor@.discussions.microsoft.com> wrote in message
news:A89E4115-09EF-4AC0-998E-9C6C9AEDAB07@.microsoft.com...
> Thank you Teo,
> API to hide/show/change/etc. fields or any items. Probably it can be done
> by
> manipulating XML file .rdlc, but is there any API for this already?
> Also, can I build my own dataset and then based on it build my report,
> during design time and during run time?
> And Teo, are you going to write another book on SSRS, but now based on
> 2005?
> Thanks.
>
> "Teo Lachev [MVP]" wrote:
>> Something like the code below. What APIs do you need at design time?
>> ' Load the dataset
>> adapter.Fill(dataset)
>> ' Local report
>> reportViewer.ProcessingMode = ProcessingMode.Local
>> reportViewer.LocalReport.EnableHyperlinks = True
>> ' Set RDL file
>> reportViewer.LocalReport.ReportPath = "Sales Forecast.rdlc"
>> ' Supply a DataTable for the report data source
>> reportViewer.LocalReport.DataSources.Add(New
>> ReportDataSource("SalesForecast_Table", dataset.Tables(0)))
>> ' Set the report parameters. Notice that the parameters array is 0-based,
>> hence (1) for two parameters
>> Dim parameters(1) As ReportParameter
>> parameters(0) = New ReportParameter("Year", 2003)
>> parameters(1) = New ReportParameter("NumberMonths", 3)
>> reportViewer.LocalReport.SetParameters(parameters)
>> reportViewer.RefreshReport()
>>
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "Victor" <Victor@.discussions.microsoft.com> wrote in message
>> news:BA5E4C4F-A866-4929-9E30-07552EDF687E@.microsoft.com...
>> > Hi,
>> > I have some experience with RS 2000, but just started 2005.
>> > I am trying to incorporate reports into my application using report
>> > viewer,
>> > no server.
>> > I will report from the data set that I created inside of my app. It is
>> > also
>> > possible that based on user's input some fields can be suppressed.
>> >
>> > I know that I can use business objects, but it looks like I have
>> > everything
>> > in my data set. So, can I build my report(s) from this data set in
>> > design
>> > time (how can I see my data set as data source?)?
>> >
>> > And another question, is there any API to manipulate controls on report
>> > during design time? I spent a lot of time with Crystal - I can do this
>> > there.
>> > I hope RS has something like this or even better.
>> >
>> > Thanks.
>>|||I am new to .Net and would appreciate little bit more clarification on
Victor's question as to 'How can I build my report(s) from this data
set in design
time (how can I see my data set as data source?)?. I am actually
planning to use DataReader and than load a DataTable with the reader
and use that as my Report Datasource. Any suggestion on the approach is
welcome.
Thanks,
Srivast
Teo Lachev [MVP] wrote:
> The APIs are XML DOM. since RDL is XML-based. If you have too much
> manipulation to do, consider buiding an object model on top of it. That's
> what I am doing for my currect project. Yes, you can use VS.NET 2005 to
> design your report.
> About the book...I decided to skip 2005. The new one is about SSAS 2005 and
> BI (http://www.prologika.com/Books/0976635305/Book.aspx)
> --
> HTH,
> ---
> Teo Lachev, MVP, MCSD, MCT
> "Microsoft Reporting Services in Action"
> "Applied Microsoft Analysis Services 2005"
> Home page and blog: http://www.prologika.com/
> ---
> "Victor" <Victor@.discussions.microsoft.com> wrote in message
> news:A89E4115-09EF-4AC0-998E-9C6C9AEDAB07@.microsoft.com...
> > Thank you Teo,
> >
> > API to hide/show/change/etc. fields or any items. Probably it can be done
> > by
> > manipulating XML file .rdlc, but is there any API for this already?
> >
> > Also, can I build my own dataset and then based on it build my report,
> > during design time and during run time?
> >
> > And Teo, are you going to write another book on SSRS, but now based on
> > 2005?
> >
> > Thanks.
> >
> >
> > "Teo Lachev [MVP]" wrote:
> >
> >> Something like the code below. What APIs do you need at design time?
> >>
> >> ' Load the dataset
> >>
> >> adapter.Fill(dataset)
> >>
> >> ' Local report
> >>
> >> reportViewer.ProcessingMode = ProcessingMode.Local
> >>
> >> reportViewer.LocalReport.EnableHyperlinks = True
> >>
> >> ' Set RDL file
> >>
> >> reportViewer.LocalReport.ReportPath = "Sales Forecast.rdlc"
> >>
> >> ' Supply a DataTable for the report data source
> >>
> >> reportViewer.LocalReport.DataSources.Add(New
> >> ReportDataSource("SalesForecast_Table", dataset.Tables(0)))
> >>
> >> ' Set the report parameters. Notice that the parameters array is 0-based,
> >> hence (1) for two parameters
> >>
> >> Dim parameters(1) As ReportParameter
> >>
> >> parameters(0) = New ReportParameter("Year", 2003)
> >>
> >> parameters(1) = New ReportParameter("NumberMonths", 3)
> >>
> >> reportViewer.LocalReport.SetParameters(parameters)
> >>
> >> reportViewer.RefreshReport()
> >>
> >>
> >> --
> >> HTH,
> >> ---
> >> Teo Lachev, MVP, MCSD, MCT
> >> "Microsoft Reporting Services in Action"
> >> "Applied Microsoft Analysis Services 2005"
> >> Home page and blog: http://www.prologika.com/
> >>
> >> ---
> >> "Victor" <Victor@.discussions.microsoft.com> wrote in message
> >> news:BA5E4C4F-A866-4929-9E30-07552EDF687E@.microsoft.com...
> >> > Hi,
> >> > I have some experience with RS 2000, but just started 2005.
> >> > I am trying to incorporate reports into my application using report
> >> > viewer,
> >> > no server.
> >> > I will report from the data set that I created inside of my app. It is
> >> > also
> >> > possible that based on user's input some fields can be suppressed.
> >> >
> >> > I know that I can use business objects, but it looks like I have
> >> > everything
> >> > in my data set. So, can I build my report(s) from this data set in
> >> > design
> >> > time (how can I see my data set as data source?)?
> >> >
> >> > And another question, is there any API to manipulate controls on report
> >> > during design time? I spent a lot of time with Crystal - I can do this
> >> > there.
> >> > I hope RS has something like this or even better.
> >> >
> >> > Thanks.
> >>
> >>
> >>|||I have done this and the code that Teo posted will work for you. What I have
found easiest is to design a report using the Reporting Services designer
(you can design without a server). The UI is much easier. Get the report to
work. Then copy over the rdl file renaming it to rdlc. Then use the control
setting it to the rdlc file and giving it your datatable. Note that in local
mode you have to handle subreports and other actions that are done for you
automatically in server mode. So, although you can do this, if you are using
the server product I would evaluate whether you really should do it.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Srivast" <sarita.srivastava@.avon.com> wrote in message
news:1133884592.106808.80610@.g43g2000cwa.googlegroups.com...
>I am new to .Net and would appreciate little bit more clarification on
> Victor's question as to 'How can I build my report(s) from this data
> set in design
> time (how can I see my data set as data source?)?. I am actually
> planning to use DataReader and than load a DataTable with the reader
> and use that as my Report Datasource. Any suggestion on the approach is
> welcome.
> Thanks,
> Srivast
>
> Teo Lachev [MVP] wrote:
>> The APIs are XML DOM. since RDL is XML-based. If you have too much
>> manipulation to do, consider buiding an object model on top of it. That's
>> what I am doing for my currect project. Yes, you can use VS.NET 2005 to
>> design your report.
>> About the book...I decided to skip 2005. The new one is about SSAS 2005
>> and
>> BI (http://www.prologika.com/Books/0976635305/Book.aspx)
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "Victor" <Victor@.discussions.microsoft.com> wrote in message
>> news:A89E4115-09EF-4AC0-998E-9C6C9AEDAB07@.microsoft.com...
>> > Thank you Teo,
>> >
>> > API to hide/show/change/etc. fields or any items. Probably it can be
>> > done
>> > by
>> > manipulating XML file .rdlc, but is there any API for this already?
>> >
>> > Also, can I build my own dataset and then based on it build my report,
>> > during design time and during run time?
>> >
>> > And Teo, are you going to write another book on SSRS, but now based on
>> > 2005?
>> >
>> > Thanks.
>> >
>> >
>> > "Teo Lachev [MVP]" wrote:
>> >
>> >> Something like the code below. What APIs do you need at design time?
>> >>
>> >> ' Load the dataset
>> >>
>> >> adapter.Fill(dataset)
>> >>
>> >> ' Local report
>> >>
>> >> reportViewer.ProcessingMode = ProcessingMode.Local
>> >>
>> >> reportViewer.LocalReport.EnableHyperlinks = True
>> >>
>> >> ' Set RDL file
>> >>
>> >> reportViewer.LocalReport.ReportPath = "Sales Forecast.rdlc"
>> >>
>> >> ' Supply a DataTable for the report data source
>> >>
>> >> reportViewer.LocalReport.DataSources.Add(New
>> >> ReportDataSource("SalesForecast_Table", dataset.Tables(0)))
>> >>
>> >> ' Set the report parameters. Notice that the parameters array is
>> >> 0-based,
>> >> hence (1) for two parameters
>> >>
>> >> Dim parameters(1) As ReportParameter
>> >>
>> >> parameters(0) = New ReportParameter("Year", 2003)
>> >>
>> >> parameters(1) = New ReportParameter("NumberMonths", 3)
>> >>
>> >> reportViewer.LocalReport.SetParameters(parameters)
>> >>
>> >> reportViewer.RefreshReport()
>> >>
>> >>
>> >> --
>> >> HTH,
>> >> ---
>> >> Teo Lachev, MVP, MCSD, MCT
>> >> "Microsoft Reporting Services in Action"
>> >> "Applied Microsoft Analysis Services 2005"
>> >> Home page and blog: http://www.prologika.com/
>> >>
>> >> ---
>> >> "Victor" <Victor@.discussions.microsoft.com> wrote in message
>> >> news:BA5E4C4F-A866-4929-9E30-07552EDF687E@.microsoft.com...
>> >> > Hi,
>> >> > I have some experience with RS 2000, but just started 2005.
>> >> > I am trying to incorporate reports into my application using report
>> >> > viewer,
>> >> > no server.
>> >> > I will report from the data set that I created inside of my app. It
>> >> > is
>> >> > also
>> >> > possible that based on user's input some fields can be suppressed.
>> >> >
>> >> > I know that I can use business objects, but it looks like I have
>> >> > everything
>> >> > in my data set. So, can I build my report(s) from this data set in
>> >> > design
>> >> > time (how can I see my data set as data source?)?
>> >> >
>> >> > And another question, is there any API to manipulate controls on
>> >> > report
>> >> > during design time? I spent a lot of time with Crystal - I can do
>> >> > this
>> >> > there.
>> >> > I hope RS has something like this or even better.
>> >> >
>> >> > Thanks.
>> >>
>> >>
>> >>
>|||Precisely. Accidentally, I am working on a two-part article for DevX that
will cover the report viewers in more details. I will post an announcement
when it is published.
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:OVnkcBo%23FHA.1600@.TK2MSFTNGP11.phx.gbl...
>I have done this and the code that Teo posted will work for you. What I
>have found easiest is to design a report using the Reporting Services
>designer (you can design without a server). The UI is much easier. Get the
>report to work. Then copy over the rdl file renaming it to rdlc. Then use
>the control setting it to the rdlc file and giving it your datatable. Note
>that in local mode you have to handle subreports and other actions that are
>done for you automatically in server mode. So, although you can do this, if
>you are using the server product I would evaluate whether you really should
>do it.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Srivast" <sarita.srivastava@.avon.com> wrote in message
> news:1133884592.106808.80610@.g43g2000cwa.googlegroups.com...
>>I am new to .Net and would appreciate little bit more clarification on
>> Victor's question as to 'How can I build my report(s) from this data
>> set in design
>> time (how can I see my data set as data source?)?. I am actually
>> planning to use DataReader and than load a DataTable with the reader
>> and use that as my Report Datasource. Any suggestion on the approach is
>> welcome.
>> Thanks,
>> Srivast
>>
>> Teo Lachev [MVP] wrote:
>> The APIs are XML DOM. since RDL is XML-based. If you have too much
>> manipulation to do, consider buiding an object model on top of it.
>> That's
>> what I am doing for my currect project. Yes, you can use VS.NET 2005 to
>> design your report.
>> About the book...I decided to skip 2005. The new one is about SSAS 2005
>> and
>> BI (http://www.prologika.com/Books/0976635305/Book.aspx)
>> --
>> HTH,
>> ---
>> Teo Lachev, MVP, MCSD, MCT
>> "Microsoft Reporting Services in Action"
>> "Applied Microsoft Analysis Services 2005"
>> Home page and blog: http://www.prologika.com/
>> ---
>> "Victor" <Victor@.discussions.microsoft.com> wrote in message
>> news:A89E4115-09EF-4AC0-998E-9C6C9AEDAB07@.microsoft.com...
>> > Thank you Teo,
>> >
>> > API to hide/show/change/etc. fields or any items. Probably it can be
>> > done
>> > by
>> > manipulating XML file .rdlc, but is there any API for this already?
>> >
>> > Also, can I build my own dataset and then based on it build my report,
>> > during design time and during run time?
>> >
>> > And Teo, are you going to write another book on SSRS, but now based on
>> > 2005?
>> >
>> > Thanks.
>> >
>> >
>> > "Teo Lachev [MVP]" wrote:
>> >
>> >> Something like the code below. What APIs do you need at design time?
>> >>
>> >> ' Load the dataset
>> >>
>> >> adapter.Fill(dataset)
>> >>
>> >> ' Local report
>> >>
>> >> reportViewer.ProcessingMode = ProcessingMode.Local
>> >>
>> >> reportViewer.LocalReport.EnableHyperlinks = True
>> >>
>> >> ' Set RDL file
>> >>
>> >> reportViewer.LocalReport.ReportPath = "Sales Forecast.rdlc"
>> >>
>> >> ' Supply a DataTable for the report data source
>> >>
>> >> reportViewer.LocalReport.DataSources.Add(New
>> >> ReportDataSource("SalesForecast_Table", dataset.Tables(0)))
>> >>
>> >> ' Set the report parameters. Notice that the parameters array is
>> >> 0-based,
>> >> hence (1) for two parameters
>> >>
>> >> Dim parameters(1) As ReportParameter
>> >>
>> >> parameters(0) = New ReportParameter("Year", 2003)
>> >>
>> >> parameters(1) = New ReportParameter("NumberMonths", 3)
>> >>
>> >> reportViewer.LocalReport.SetParameters(parameters)
>> >>
>> >> reportViewer.RefreshReport()
>> >>
>> >>
>> >> --
>> >> HTH,
>> >> ---
>> >> Teo Lachev, MVP, MCSD, MCT
>> >> "Microsoft Reporting Services in Action"
>> >> "Applied Microsoft Analysis Services 2005"
>> >> Home page and blog: http://www.prologika.com/
>> >>
>> >> ---
>> >> "Victor" <Victor@.discussions.microsoft.com> wrote in message
>> >> news:BA5E4C4F-A866-4929-9E30-07552EDF687E@.microsoft.com...
>> >> > Hi,
>> >> > I have some experience with RS 2000, but just started 2005.
>> >> > I am trying to incorporate reports into my application using report
>> >> > viewer,
>> >> > no server.
>> >> > I will report from the data set that I created inside of my app. It
>> >> > is
>> >> > also
>> >> > possible that based on user's input some fields can be suppressed.
>> >> >
>> >> > I know that I can use business objects, but it looks like I have
>> >> > everything
>> >> > in my data set. So, can I build my report(s) from this data set in
>> >> > design
>> >> > time (how can I see my data set as data source?)?
>> >> >
>> >> > And another question, is there any API to manipulate controls on
>> >> > report
>> >> > during design time? I spent a lot of time with Crystal - I can do
>> >> > this
>> >> > there.
>> >> > I hope RS has something like this or even better.
>> >> >
>> >> > Thanks.
>> >>
>> >>
>> >>
>|||I have used the code above to write a report browser. The first report
shows fine, only if I select a different repport the first report keeps
coming back. No errors no messages. This is the code I use. Does
anybody knows the solution?
Thank you,
Arjan
private void button1_Click(object sender, EventArgs e)
{
this.openFileDialog1.InitialDirectory =System.Reflection.Assembly.GetExecutingAssembly().Location;
DialogResult _result = this.openFileDialog1.ShowDialog();
if (_result == DialogResult.OK)
{
string _fileName =this.openFileDialog1.FileName.ToString();
if (Path.GetExtension(_fileName) == ".rdlc")
{
this.reportViewer1.ProcessingMode =ProcessingMode.Local;
FileStream _stream = File.OpenRead(_fileName);
this.reportViewer1.LocalReport.LoadReportDefinition(_stream);
_stream.Close();
foreach (string _dataSetName in
this.reportViewer1.LocalReport.GetDataSourceNames())
{
DataTable _dt = new DataTable();
SqlCommand _command = new SqlCommand("SELECT *
FROM " + _dataSetName.Replace("ProjectDataSet_", ""), new
SqlConnection("ConnectionString"));
_command.CommandType = CommandType.Text;
new SqlDataAdapter(_command).Fill(_dt);
ReportDataSource _reportDataSource = new
ReportDataSource();
_reportDataSource.Name = _dataSetName;
_reportDataSource.Value = _dt;
this.reportViewer1.LocalReport.DataSources.Add(_reportDataSource);
}
this.reportViewer1.RefreshReport();
}
else
{
MessageBox.Show("Invalid extension");
}
}
}|||Try reportViewer1.Reset() before rendering. Also, I noticed that you are
calling LoadReportDefinition. This method will render the report ad-hoc. I
think what you need here is just setting the ReportPath to your rdlc file,
e.g.
reportViewer1.LocalReport.ReportPath = "<myreportname>.rdlc"
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
<arjan@.synion.nl> wrote in message
news:1134056833.592280.285570@.g14g2000cwa.googlegroups.com...
>I have used the code above to write a report browser. The first report
> shows fine, only if I select a different repport the first report keeps
> coming back. No errors no messages. This is the code I use. Does
> anybody knows the solution?
> Thank you,
> Arjan
> private void button1_Click(object sender, EventArgs e)
> {
> this.openFileDialog1.InitialDirectory => System.Reflection.Assembly.GetExecutingAssembly().Location;
> DialogResult _result = this.openFileDialog1.ShowDialog();
> if (_result == DialogResult.OK)
> {
> string _fileName => this.openFileDialog1.FileName.ToString();
> if (Path.GetExtension(_fileName) == ".rdlc")
> {
> this.reportViewer1.ProcessingMode => ProcessingMode.Local;
> FileStream _stream = File.OpenRead(_fileName);
> this.reportViewer1.LocalReport.LoadReportDefinition(_stream);
> _stream.Close();
> foreach (string _dataSetName in
> this.reportViewer1.LocalReport.GetDataSourceNames())
> {
> DataTable _dt = new DataTable();
> SqlCommand _command = new SqlCommand("SELECT *
> FROM " + _dataSetName.Replace("ProjectDataSet_", ""), new
> SqlConnection("ConnectionString"));
> _command.CommandType = CommandType.Text;
> new SqlDataAdapter(_command).Fill(_dt);
> ReportDataSource _reportDataSource = new
> ReportDataSource();
> _reportDataSource.Name = _dataSetName;
> _reportDataSource.Value = _dt;
>
> this.reportViewer1.LocalReport.DataSources.Add(_reportDataSource);
> }
> this.reportViewer1.RefreshReport();
> }
> else
> {
> MessageBox.Show("Invalid extension");
> }
> }
> }
>|||Yes that did the trick! Thank you!
I want to alter a 'template' rdlc with new values and stream the result
to the reportviewer control. That is why I used the stream.
Does anyone know an opensource project 'rdl(c) file to class'? Input is
the path to an rdl(c) file, output is a class with all the settings in
the file. Simply alter class and stream class.ToSring() to the viewer.
Thank you,
Arjan|||I have noticed that the webform reportviewer does not have the Reset
method. What to do on a webform when changing reports in local mode?
Thank you,
Arjan|||We developed our own object wrapper on top of RDL. It is not that hard to do
given that the RDL spec is out there
(http://download.microsoft.com/download/c/2/0/c2091a26-d7bf-4464-8535-dbc31fb45d3c/rdlNov05.pdf)
and it really pays out in a long run. http://www.fyireporting.com/ could be
a good start.
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"Arjan" <arjan@.synion.nl> wrote in message
news:1134310904.001437.37200@.g47g2000cwa.googlegroups.com...
> Yes that did the trick! Thank you!
> I want to alter a 'template' rdlc with new values and stream the result
> to the reportviewer control. That is why I used the stream.
> Does anyone know an opensource project 'rdl(c) file to class'? Input is
> the path to an rdl(c) file, output is a class with all the settings in
> the file. Simply alter class and stream class.ToSring() to the viewer.
> Thank you,
> Arjan
>

Friday, February 24, 2012

Local Groups and Access.

I'm trying to prototype some reports, and having difficulties granting access
to users, connecting to my LocalHost.
I work for a company that uses LDAP.
I have RS running on my LocalHost, and would like to grant access to users
to Report Manager so they can render reports.
In the Computer management > Local Users & Groups > Groups: I see Users,
Guests. Can I add these group(s) in the Report Manager using 'New Role
Assignment', and assign a Role, like Browser, then will a unknown user be
able to visit the site and render some reports.
Thanks,
rwiethornI'm getting closer, the user can see the reportmanger but cannot run a report.
Here is what I did:
I created a user on my local machine, call him Bob. I then created a group
on my local machine, called ReportViewers, and added Bob to the group. I then
added the group to ReportManager, gave it a Content Manager role, and for
'Configure site-wide security', System Role Assignments, assigned the group
as System Users.
However, they can not view the report. Ther error points to the Datasource.
The Datasource is supposed to pull a recordset from the AdventureWorks
catalog. It uses the SA account. When I look at the datasource in the
ReportManager, the credentials are saved (user name: sa and its password).
So why would that not return the results from the AdventureWorks database?
Do I neeed to add the local group also to the Database and catalog?
Do I need to add the IUSR_machine account to the database?
Do I need to add the ASPNET account to the group?
All help is appreciated,
thanks, confused,
rwiethorn
"rwiethorn" wrote:
> I'm trying to prototype some reports, and having difficulties granting access
> to users, connecting to my LocalHost.
> I work for a company that uses LDAP.
> I have RS running on my LocalHost, and would like to grant access to users
> to Report Manager so they can render reports.
> In the Computer management > Local Users & Groups > Groups: I see Users,
> Guests. Can I add these group(s) in the Report Manager using 'New Role
> Assignment', and assign a Role, like Browser, then will a unknown user be
> able to visit the site and render some reports.
> Thanks,
> rwiethorn

Monday, February 20, 2012

Local - Printing margins are off by ~1/8 inch

I am printing my reports from my local report viewr, and the margins are off by just a little bit. It looks like printing shifts the contents of the report 1/8 inch to the right, borking the margins.
    Report body is 7" wide Margins are .75" inch on all sides Print Preview mode displays the report properly, centered Output is similarly skewed on all printers (tried 4) This is using the VS SP1 version of the RS dll's.
However, when I print the report I get it shifted to the right by 1/8 inch. This leaves me with a 7/8" margin on the left, and a 5/8" margin on the right.

Setting the margins to Left: 0.625, Right: 0.875 (5/8&7/8) actually causes it to print centered, so I know it is paying attention. When I do this, the print layout mode shows the contents shifted to the left 1/8", as expected.

I assume that people print using this control, or at least it was tested, so has anyone else seen this or is it a confirmed bug?

//5ive

Check which version of SSRS you are running. I would highly suggest visting this page http://www.sqlservercentral.com/columnists/sjones/2960.asp and reading the information. It helped me a lot as I had also been frequently dealing with this printing bug. Good luck!