Friday, March 23, 2012
Reset Page Numbering Total
For example
Group A - 3 pages
Group B - 4 pages
So for group B on the 4th page it will start with 1, using the following
code this does this fine
Shared offset As Integer
Public Function GetPN(reset As Boolean, pagenumber As Integer) As Integer
If reset
offset = pagenumber - 1
End If
Return pagenumber - offset
End Function
I am wanting to do this for the total of the pages as well so for example
page 4 would show as 1 of 4 instead of 1 of 7
How do I get this working for the total pages as well as the individual pagesI have the same problem, did you come up with any solution?
"Mark Stanley" wrote:
> I am wanting to reset the page number on the break of each group.
> For example
> Group A - 3 pages
> Group B - 4 pages
> So for group B on the 4th page it will start with 1, using the following
> code this does this fine
> Shared offset As Integer
> Public Function GetPN(reset As Boolean, pagenumber As Integer) As Integer
> If reset
> offset = pagenumber - 1
> End If
> Return pagenumber - offset
> End Function
> I am wanting to do this for the total of the pages as well so for example
> page 4 would show as 1 of 4 instead of 1 of 7
> How do I get this working for the total pages as well as the individual pages|||Jim,
See my earlier posting in this thread.
It's not a simple solution but it might help.
Chris
JIM.H. wrote:
> I have the same problem, did you come up with any solution?
> "Mark Stanley" wrote:
> > I am wanting to reset the page number on the break of each group.
> >
> > For example
> >
> > Group A - 3 pages
> > Group B - 4 pages
> >
> > So for group B on the 4th page it will start with 1, using the
> > following code this does this fine
> >
> > Shared offset As Integer
> >
> > Public Function GetPN(reset As Boolean, pagenumber As Integer) As
> > Integer If reset
> > offset = pagenumber - 1
> > End If
> > Return pagenumber - offset
> > End Function
> >
> > I am wanting to do this for the total of the pages as well so for
> > example page 4 would show as 1 of 4 instead of 1 of 7
> >
> > How do I get this working for the total pages as well as the
> > individual pages|||Hi Chris,
Did you mean you attached something in the previous message, I am using web
interface and do not know how to see attachments.
"Chris McGuigan" wrote:
> Jim,
> See my earlier posting in this thread.
> It's not a simple solution but it might help.
> Chris
>
> JIM.H. wrote:
> > I have the same problem, did you come up with any solution?
> >
> > "Mark Stanley" wrote:
> >
> > > I am wanting to reset the page number on the break of each group.
> > >
> > > For example
> > >
> > > Group A - 3 pages
> > > Group B - 4 pages
> > >
> > > So for group B on the 4th page it will start with 1, using the
> > > following code this does this fine
> > >
> > > Shared offset As Integer
> > >
> > > Public Function GetPN(reset As Boolean, pagenumber As Integer) As
> > > Integer If reset
> > > offset = pagenumber - 1
> > > End If
> > > Return pagenumber - offset
> > > End Function
> > >
> > > I am wanting to do this for the total of the pages as well so for
> > > example page 4 would show as 1 of 4 instead of 1 of 7
> > >
> > > How do I get this working for the total pages as well as the
> > > individual pages
>|||Jim,
Here is the contents of the file;
----
Unfortunately, there's currently no good way to build a table of
contents.
And even adding defined execution order isn't going to help, since
pagination happens as a completely separate step from the rest of the
report. This is because you can request the same report with different
page
size/margin settings (and even an entirely different rendering target,
which
could radically change pagination). Under normal circumstances, we don't
want to force reexecution of the entire report just because you change
your
margins.
To handle table of contents type operations, we're going to (eventually)
have to implement an entirely new mode wherein we know that the body of
the
report contains references to page numbers, which will force the entire
report to reexecute if pagination information changes.
In the mean time, there's no general solution for the table of contents
problem.
But... Since you're doing this in a batch once a month, you may not
need a
fully general solution.
Without further ado, here's Sleazy Hack #792 ("Simulating Table of
Contents
in Batch Reporting Scenarios"):
1. Write a custom assembly containing a class that can write rows to a
TableOfContents table in your database.
Have shared methods for both initializing the TOC and writing a new
row
to the TOC.
Note: Don't forget to give it database permissions in the CAS file
when
you deploy it to your server.
See the documentation for details on custom assemblies.
2. In the Code section of the report, call the TOC initialization in
the
OnInit() event.
3. At the start of each section you want to appear in your TOC, put a
hidden textbox that contains the label you want to appear in your TOC.
4. In the page header, put a hidden textbox with something like the
following expression:
=Code.MyTOCClass.AddToTOC(Globals.PageNumber,ReportItems!Textbox1.Value
& ReportItems!Textbox2.Value & ReportItems!Textbox3.Value)
Texbox1, Textbox2 and Textbox3 are the names of the hidden textboxes
from step 3 (since only one will appear on any given page, the rest
will be
empty)
5. Add a dataset to your report which selects from the TableOfContents
table
6. Display the results of the TOC data set in a table at the end of
your
report*
7. Run the report twice. The first time will initialize the TOC. The
second time will use the values from the previous run.
* If you want it at the beginning, you'll either need to run the report
three times (the first to get some rows into the TOC table, the second
to
get the numbers populated correctly and the third to use those numbers)
or
you'll need to make sure the TOC table has the right number of rows to
begin
with (perhaps by not emptying it from the previous month) otherwise your
page numbers will be incorrect due to the TOC pushing things around.
This
isn't an issue if your TOC is only one page long and has PageBreakAtEnd,
however.
JIM.H. wrote:
> Hi Chris,
> Did you mean you attached something in the previous message, I am
> using web interface and do not know how to see attachments.
> "Chris McGuigan" wrote:
> > Jim,
> > See my earlier posting in this thread.
> > It's not a simple solution but it might help.
> >
> > Chris
> >
> >
> > JIM.H. wrote:
> >
> > > I have the same problem, did you come up with any solution?
> > >
> > > "Mark Stanley" wrote:
> > >
> > > > I am wanting to reset the page number on the break of each
> > > > group.
> > > >
> > > > For example
> > > >
> > > > Group A - 3 pages
> > > > Group B - 4 pages
> > > >
> > > > So for group B on the 4th page it will start with 1, using the
> > > > following code this does this fine
> > > >
> > > > Shared offset As Integer
> > > >
> > > > Public Function GetPN(reset As Boolean, pagenumber As Integer)
> > > > As Integer If reset
> > > > offset = pagenumber - 1
> > > > End If
> > > > Return pagenumber - offset
> > > > End Function
> > > >
> > > > I am wanting to do this for the total of the pages as well so
> > > > for example page 4 would show as 1 of 4 instead of 1 of 7
> > > >
> > > > How do I get this working for the total pages as well as the
> > > > individual pages
> >
> >|||Yes there was an attachment. You'll need a "proper" newsreader - I
recommend XanaNews, which can be downloaded at
http://www.wilsonc.demon.co.uk/d9xananews.htm
I've put the contents in another post for you.
Chris
JIM.H. wrote:
> Hi Chris,
> Did you mean you attached something in the previous message, I am
> using web interface and do not know how to see attachments.
> "Chris McGuigan" wrote:
> > Jim,
> > See my earlier posting in this thread.
> > It's not a simple solution but it might help.
> >
> > Chris
> >
> >
> > JIM.H. wrote:
> >
> > > I have the same problem, did you come up with any solution?
> > >
> > > "Mark Stanley" wrote:
> > >
> > > > I am wanting to reset the page number on the break of each
> > > > group.
> > > >
> > > > For example
> > > >
> > > > Group A - 3 pages
> > > > Group B - 4 pages
> > > >
> > > > So for group B on the 4th page it will start with 1, using the
> > > > following code this does this fine
> > > >
> > > > Shared offset As Integer
> > > >
> > > > Public Function GetPN(reset As Boolean, pagenumber As Integer)
> > > > As Integer If reset
> > > > offset = pagenumber - 1
> > > > End If
> > > > Return pagenumber - offset
> > > > End Function
> > > >
> > > > I am wanting to do this for the total of the pages as well so
> > > > for example page 4 would show as 1 of 4 instead of 1 of 7
> > > >
> > > > How do I get this working for the total pages as well as the
> > > > individual pages
> >
> >
Wednesday, March 21, 2012
Rescursive Sort Sql Server 2005. How to sort by name in a function (see example)
I have this example. My question is, how can I sort after "sortcol" and
"empname" ?
I mean, I get with this function all the nodes sorted but behalft the nodes
I want to
sort to "empname". How can I do this?
WITH NodeTree2(empid, empname, mgrid, depth, sortcol)
AS
(
SELECT empid, empname, mgrid, 0, CAST(empid AS VARBINARY(900))
FROM employees
WHERE empid = 1
UNION ALL
SELECT E.empid, E.empname, E.mgrid, M.depth+1, CAST(sortcol + CAST(E.empid
AS BINARY(4)) AS VARBINARY(900))
FROM Employees AS E
JOIN EmpCTE AS M
ON E.mgrid = M.empid
)
SELECT
REPLICATE('| ', depth)
+ '(' + (CAST(empid AS VARCHAR(10))) + ') '
+ empname AS empname
FROM EmpCTE
ORDER BY sortcol
Thanks for helping me!
AndreasAndreas,
Construct the binary sort path out of row numbers based on mgrid
partitioning and empname sorting:
WITH EmpCTE(empid, empname, mgrid, depth, sortcol)
AS
(
SELECT empid, empname, mgrid, 0, CAST(1 AS VARBINARY(MAX))
FROM employees
WHERE empid = 1
UNION ALL
SELECT E.empid, E.empname, E.mgrid, M.depth+1,
sortcol + CAST(
ROW_NUMBER() OVER(PARTITION BY E.mgrid ORDER BY E.empname)
AS BINARY(4))
FROM Employees AS E
JOIN EmpCTE AS M
ON E.mgrid = M.empid
)
SELECT
REPLICATE('| ', depth)
+ '(' + (CAST(empid AS VARCHAR(10))) + ') '
+ empname AS empname
FROM EmpCTE
ORDER BY sortcol;
BG, SQL Server MVP
www.SolidQualityLearning.com
www.insidetsql.com
Anything written in this message represents my view, my own view, and
nothing but my view (WITH SCHEMABINDING), so help me my T-SQL code.
"Andreas Klemt" <aklemt68@.hotmail.com> wrote in message
news:%23xtB3ROiGHA.3848@.TK2MSFTNGP04.phx.gbl...
> Hello,
> I have this example. My question is, how can I sort after "sortcol" and
> "empname" ?
> I mean, I get with this function all the nodes sorted but behalft the
> nodes I want to
> sort to "empname". How can I do this?
> WITH NodeTree2(empid, empname, mgrid, depth, sortcol)
> AS
> (
> SELECT empid, empname, mgrid, 0, CAST(empid AS VARBINARY(900))
> FROM employees
> WHERE empid = 1
> UNION ALL
> SELECT E.empid, E.empname, E.mgrid, M.depth+1, CAST(sortcol + CAST(E.empid
> AS BINARY(4)) AS VARBINARY(900))
> FROM Employees AS E
> JOIN EmpCTE AS M
> ON E.mgrid = M.empid
> )
> SELECT
> REPLICATE('| ', depth)
> + '(' + (CAST(empid AS VARCHAR(10))) + ') '
> + empname AS empname
> FROM EmpCTE
> ORDER BY sortcol
> Thanks for helping me!
> Andreas
>
Tuesday, March 20, 2012
Required disk space to reindex
I would like to know the amount of free space I need to reindex a clustered
index. For a clustered index using 100 GB for example, how much data free
space I need ? (I am not talking about the transactional log) ?
Thanks in advance,
Regards,
Vincent
Vincent
100 GB *2= 200 GB
"Vincent D." <VincentD@.discussions.microsoft.com> wrote in message
news:8E183CCA-3E97-4BC7-9A3A-D118682B20FB@.microsoft.com...
> Hello,
> I would like to know the amount of free space I need to reindex a
> clustered
> index. For a clustered index using 100 GB for example, how much data free
> space I need ? (I am not talking about the transactional log) ?
> Thanks in advance,
> Regards,
> Vincent
|||Are you saying that you have a table with a clustered index, and that index tree (which contains the
data) is using 100GB. For that you will need somewhere around 120 GB free space in the database to
rebuild the index. I.e., the size of the index plus some.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Vincent D." <VincentD@.discussions.microsoft.com> wrote in message
news:8E183CCA-3E97-4BC7-9A3A-D118682B20FB@.microsoft.com...
> Hello,
> I would like to know the amount of free space I need to reindex a clustered
> index. For a clustered index using 100 GB for example, how much data free
> space I need ? (I am not talking about the transactional log) ?
> Thanks in advance,
> Regards,
> Vincent
|||> Are you saying that you have a table with a clustered index, and that
> index tree (which contains the data) is using 100GB. For that you will
> need somewhere around 120 GB free space in the database to rebuild the
> index. I.e., the size of the index plus some.
To be safe, I would usually ballpark at 1.5x the index size.
Monday, March 12, 2012
Required disk space to reindex
I would like to know the amount of free space I need to reindex a clustered
index. For a clustered index using 100 GB for example, how much data free
space I need ? (I am not talking about the transactional log) ?
Thanks in advance,
Regards,
VincentVincent
100 GB *2= 200 GB
"Vincent D." <VincentD@.discussions.microsoft.com> wrote in message
news:8E183CCA-3E97-4BC7-9A3A-D118682B20FB@.microsoft.com...
> Hello,
> I would like to know the amount of free space I need to reindex a
> clustered
> index. For a clustered index using 100 GB for example, how much data free
> space I need ? (I am not talking about the transactional log) ?
> Thanks in advance,
> Regards,
> Vincent|||Are you saying that you have a table with a clustered index, and that index tree (which contains the
data) is using 100GB. For that you will need somewhere around 120 GB free space in the database to
rebuild the index. I.e., the size of the index plus some.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Vincent D." <VincentD@.discussions.microsoft.com> wrote in message
news:8E183CCA-3E97-4BC7-9A3A-D118682B20FB@.microsoft.com...
> Hello,
> I would like to know the amount of free space I need to reindex a clustered
> index. For a clustered index using 100 GB for example, how much data free
> space I need ? (I am not talking about the transactional log) ?
> Thanks in advance,
> Regards,
> Vincent|||> Are you saying that you have a table with a clustered index, and that
> index tree (which contains the data) is using 100GB. For that you will
> need somewhere around 120 GB free space in the database to rebuild the
> index. I.e., the size of the index plus some.
To be safe, I would usually ballpark at 1.5x the index size.
Requesting querry to view structure
Can anybody please help me in writing the syntax to view the structure
of the table in sqlserver 2005.
For example in oracle if we want to see the table structure we will use
the command
desc table name.In similar way is there any command to view the table
structure we have created in sqlserver2005.
ThanksEXEC sp_help 'tablename';
"ganu" <girijak@.hotmail.com> wrote in message
news:1140547519.059657.128250@.g47g2000cwa.googlegroups.com...
> Hi,
> Can anybody please help me in writing the syntax to view the structure
> of the table in sqlserver 2005.
> For example in oracle if we want to see the table structure we will use
> the command
> desc table name.In similar way is there any command to view the table
> structure we have created in sqlserver2005.
>
> Thanks
>
requesting querry to insert date and time
Can anybody telll me how to give date and time to be printed in
sqlserver programmin.For example if u want to add data to a table using
insert command how can we enter date and time in that.
please reply me soon.
thanks for helping.Did you have a look on the getdate() function ?
INSERt INTO SomeTable
( colList ... )
VALUES
(
...
GETDATE(),
...
)
HTH, Jens Suessmeyer.|||Do you mean something like GETDATE() . This returns the system time and date
Jack Vamvas
________________________________________
__________________________
Receive free SQL tips - register at www.ciquery.com/sqlserver.htm
New article by Jack Vamvas - Improper Use of indexes on MS SQL: Server
2000 - www.ciquery.com/articles/useofindexes.asp
"gija" <girijak@.hotmail.com> wrote in message
news:1140035764.737565.125890@.g44g2000cwa.googlegroups.com...
> Hi,
> Can anybody telll me how to give date and time to be printed in
> sqlserver programmin.For example if u want to add data to a table using
> insert command how can we enter date and time in that.
> please reply me soon.
> thanks for helping.
>|||INSERT table(column) SELECT '2006-02-15T05:43:21';
INSERT table(column) VALUES('2006-02-15T05:43:21');
"gija" <girijak@.hotmail.com> wrote in message
news:1140035764.737565.125890@.g44g2000cwa.googlegroups.com...
> Hi,
> Can anybody telll me how to give date and time to be printed in
> sqlserver programmin.For example if u want to add data to a table using
> insert command how can we enter date and time in that.
> please reply me soon.
> thanks for helping.
>
Friday, March 9, 2012
Req code example of selecting MS sql MSDE database stored locally TIA sal
I'm trying to find an example in vb.net of how I can have a user select a MS
SQL database stored locally
created using MSDE.
TIAStart with this:
http://www.microsoft.com/downloads/...&displaylang=en
<sal@.spp.net> wrote in message
news:KK5id.35893$Tq1.10254@.bignews1.bellsouth.net...
> Hello,
> I'm trying to find an example in vb.net of how I can have a user select a
MS SQL database stored locally
> created using MSDE.
> TIA
>
>
Req code example of selecting MS sql MSDE database stored locally TIA sal
I'm trying to find an example in vb.net of how I can have a user select a MS SQL database stored locally
created using MSDE.
TIA
Start with this:
http://www.microsoft.com/downloads/d...displaylang=en
<sal@.spp.net> wrote in message
news:KK5id.35893$Tq1.10254@.bignews1.bellsouth.net. ..
> Hello,
> I'm trying to find an example in vb.net of how I can have a user select a
MS SQL database stored locally
> created using MSDE.
> TIA
>
>
Req code example of selecting MS sql MSDE database stored locally TIA sal
I'm trying to find an example in vb.net of how I can have a user select a MS SQL database stored locally
created using MSDE.
TIAStart with this:
http://www.microsoft.com/downloads/details.aspx?familyid=08e3d5f8-033d-420b-a3b1-3074505c03f3&displaylang=en
<sal@.spp.net> wrote in message
news:KK5id.35893$Tq1.10254@.bignews1.bellsouth.net...
> Hello,
> I'm trying to find an example in vb.net of how I can have a user select a
MS SQL database stored locally
> created using MSDE.
> TIA
>
>
Tuesday, February 21, 2012
ReportViewer-winform
Is there a way to make the data selecatable. For example, a user runs a report and wants to copy the applicationId onto their clipboard so they can use it to search in another application. Currently they have to remember or write down a 9 digit number. Not very user friendly...
I am currently using a data table as the container for the data in my rdl file. Then I use reportviewer for winforms to embed it in our user application.
Thanks
hi mpetanovitch,
You can try this for each TextBox on the Report file.
Suppose there is a table item on the Report file,
Step 1:
At the DesignTime, for each TextBox in the 'Table Details' row :
Do RightClick then go to Properties-->Navigation-->Hyperlink Action
Select 'Jump to URL' and in the following ComboBox type '= "nolink:" & Fields!FieldName.Value'
In the 'Fields!FieldName.Value', replace 'FieldName' with name of the Field containig TextBox.
Step 2:
Put the following line in the ReportViewer1_Load :
this.ReportViewer1.LocalReport.EnableHyperlinks = true;
Step 3:
Add a Handler for the ReportViewer1_HyperLink event like this :
private void ReportViewer1_Hyperlink(object sender, HyperlinkEventArgs e)
{
Uri SelText = new Uri(e.Hyperlink);
if (SelText.Scheme.ToLower() == "nolink")
{
e.Cancel = true;
this.reportViewer1.Find(SelText.AbsolutePath, this.ReportViewer1.CurrentPage);
Clipboard.Clear();
Clipboard.SetText(SelText.AbsolutePath);
}
}
Regards
A. Cheraghi
ReportViewer-winform
Is there a way to make the data selecatable. For example, a user runs a report and wants to copy the applicationId onto their clipboard so they can use it to search in another application. Currently they have to remember or write down a 9 digit number. Not very user friendly...
I am currently using a data table as the container for the data in my rdl file. Then I use reportviewer for winforms to embed it in our user application.
Thanks
hi mpetanovitch,
You can try this for each TextBox on the Report file.
Suppose there is a table item on the Report file,
Step 1:
At the DesignTime, for each TextBox in the 'Table Details' row :
Do RightClick then go to Properties-->Navigation-->Hyperlink Action
Select 'Jump to URL' and in the following ComboBox type '= "nolink:" & Fields!FieldName.Value'
In the 'Fields!FieldName.Value', replace 'FieldName' with name of the Field containig TextBox.
Step 2:
Put the following line in the ReportViewer1_Load :
this.ReportViewer1.LocalReport.EnableHyperlinks = true;
Step 3:
Add a Handler for the ReportViewer1_HyperLink event like this :
private void ReportViewer1_Hyperlink(object sender, HyperlinkEventArgs e)
{
Uri SelText = new Uri(e.Hyperlink);
if (SelText.Scheme.ToLower() == "nolink")
{
e.Cancel = true;
this.reportViewer1.Find(SelText.AbsolutePath, this.ReportViewer1.CurrentPage);
Clipboard.Clear();
Clipboard.SetText(SelText.AbsolutePath);
}
}
Regards
A. Cheraghi
ReportViewer.SizeToReportContent - has anyone got an example?
The report I am showing has drillthroughs to multiple other reports,
some of which fit on the screen and some are wider than the screen.
I would like to dynamically size the control so it matches the
interactive size of the report currently being displayed by drill
through. That way scroll bars would appear on the outside of the web
browser only when required.
I cant figure out how to do this.
I have tried setting ReportViewer1.SizeToReportContent = true; in both
ReportViewer_Drillthrough and Page_Load events but to no avail.
Has anyone got an example of this working?
Thanks,
Renato
To be clear this is what I have in the aspx:
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Enabled="true"
Width="98%" Height="600px"
OnDrillthrough = "ReportViewer1_Drillthrough">
</rsweb:ReportViewer>
In the cs:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
ReportViewer1.PromptAreaCollapsed = true;
ReportViewer1.ShowBackButton = true;
ReportViewer1.HyperlinkTarget = "_self";
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
Systm.Uri oReportServer = new
System.Uri("http://wrypgpdbs04/ReportServer/");
ReportViewer1.ServerReport.ReportServerUrl = oReportServer;
ReportViewer1.ServerReport.ReportPath = "/PGP/Sales/DailySales/DailySalesNavigation";
ReportViewer1.SizeToReportContent = true;
}
}
protected void ReportViewer1_Drillthrough(object sender,
Microsoft.Reporting.WebForms.DrillthroughEventArgs e)
{
ReportViewer1.SizeToReportContent = true;
}Hi, RBot
I would recommend removing the width and height property from the
declaration of the ReportViewer control, to see if that CSS style for
the control is not overriding the SizeToReportContent property. It
would seem that even though you set the property to true, you're
constraining the control in the browser by using those 2 style tags.
Hope that works.
Thiago
On Nov 22, 9:38 pm, "RBot" <renato_b...@.iprimus.com.au> wrote:
> I have an aspx 2.0 page using the ReportViewer control on SRS2005.
> The report I am showing has drillthroughs to multiple other reports,
> some of which fit on the screen and some are wider than the screen.
> I would like to dynamically size the control so it matches the
> interactive size of the report currently being displayed by drill
> through. That way scroll bars would appear on the outside of the web
> browser only when required.
> I cant figure out how to do this.
> I have tried setting ReportViewer1.SizeToReportContent = true; in both
> ReportViewer_Drillthrough and Page_Load events but to no avail.
> Has anyone got an example of this working?
> Thanks,
> Renato
> To be clear this is what I have in the aspx:
> <rsweb:ReportViewer ID="ReportViewer1" runat="server" Enabled="true"
> Width="98%" Height="600px"
> OnDrillthrough = "ReportViewer1_Drillthrough">
> </rsweb:ReportViewer>
> In the cs:
> protected void Page_Load(object sender, EventArgs e)
> {
> if (!Page.IsPostBack)
> {
> ReportViewer1.PromptAreaCollapsed = true;
> ReportViewer1.ShowBackButton = true;
> ReportViewer1.HyperlinkTarget = "_self";
> ReportViewer1.ProcessingMode => Microsoft.Reporting.WebForms.ProcessingMode.Remote;
> Systm.Uri oReportServer = new
> System.Uri("http://wrypgpdbs04/ReportServer/");
> ReportViewer1.ServerReport.ReportServerUrl = oReportServer;
> ReportViewer1.ServerReport.ReportPath => "/PGP/Sales/DailySales/DailySalesNavigation";
> ReportViewer1.SizeToReportContent = true;
> }
> }protected void ReportViewer1_Drillthrough(object sender,
> Microsoft.Reporting.WebForms.DrillthroughEventArgs e)
> {
> ReportViewer1.SizeToReportContent = true;
>
> }- Hide quoted text -- Show quoted text -|||Thanks Thiago,
I tried this but still get the scrollbars around a iframe-like area.
The report viewer now seems to inherit the width from its containing
div element, which in turn gets it from a shared stylesheet. I can set
the width of the div, but this is static, not responsive to the size of
the report.
I dont know what style to use to reset the width back to "vanilla".
tafs7 wrote:
> Hi, RBot
> I would recommend removing the width and height property from the
> declaration of the ReportViewer control, to see if that CSS style for
> the control is not overriding the SizeToReportContent property. It
> would seem that even though you set the property to true, you're
> constraining the control in the browser by using those 2 style tags.
> Hope that works.
> Thiago
>
> On Nov 22, 9:38 pm, "RBot" <renato_b...@.iprimus.com.au> wrote:
> > I have an aspx 2.0 page using the ReportViewer control on SRS2005.
> >
> > The report I am showing has drillthroughs to multiple other reports,
> > some of which fit on the screen and some are wider than the screen.
> > I would like to dynamically size the control so it matches the
> > interactive size of the report currently being displayed by drill
> > through. That way scroll bars would appear on the outside of the web
> > browser only when required.
> > I cant figure out how to do this.
> >
> > I have tried setting ReportViewer1.SizeToReportContent = true; in both
> > ReportViewer_Drillthrough and Page_Load events but to no avail.
> >
> > Has anyone got an example of this working?
> >
> > Thanks,
> > Renato
> >
> > To be clear this is what I have in the aspx:
> > <rsweb:ReportViewer ID="ReportViewer1" runat="server" Enabled="true"
> > Width="98%" Height="600px"
> > OnDrillthrough = "ReportViewer1_Drillthrough">
> > </rsweb:ReportViewer>
> > In the cs:
> > protected void Page_Load(object sender, EventArgs e)
> > {
> > if (!Page.IsPostBack)
> > {
> > ReportViewer1.PromptAreaCollapsed = true;
> > ReportViewer1.ShowBackButton = true;
> > ReportViewer1.HyperlinkTarget = "_self";
> > ReportViewer1.ProcessingMode => > Microsoft.Reporting.WebForms.ProcessingMode.Remote;
> > Systm.Uri oReportServer = new
> > System.Uri("http://wrypgpdbs04/ReportServer/");
> > ReportViewer1.ServerReport.ReportServerUrl = oReportServer;
> > ReportViewer1.ServerReport.ReportPath => > "/PGP/Sales/DailySales/DailySalesNavigation";
> > ReportViewer1.SizeToReportContent = true;
> > }
> >
> > }protected void ReportViewer1_Drillthrough(object sender,
> > Microsoft.Reporting.WebForms.DrillthroughEventArgs e)
> > {
> > ReportViewer1.SizeToReportContent = true;
> >
> >
> >
> > }- Hide quoted text -- Show quoted text -|||Just for the record I have sorted my issues with the ReportViewer web
control.
In the report definitions I need to ensure that the Report dimensions
are larger than the Page dimensions plus margins.
Once this is done the scrollbars dont appear for the ReportViewer
control.
Strangely this is never a problem when viewing reports directly on the
report server via http.
Renato