I am making a report in Visual Studio..Now my question is,is there anyway that i can add a tab control for my rdl?Hope to here from anyone out there with a know how..Thanks guys!!
Are you saying that you want your report that is rendered in HTML to have a tab control on it? Or are you asking if you can design the report page just like an HTML page, and drop all sorts of components on to it?
|||
uhm..my reports were being exported in HTML,Excel and PDF..But i dont really know if it is possible to add a tab control to an rdl.I am trying to add a tab control in the COM Components,but i cannot see a tab control for it.
|||do you mean you want to see the RDL (i.e. the xml rather than the GUI)?just right click on the report in solution explorer and 'view code' - it should open up a new tab with just the raw xml as text|||
thanks for the reply,but what im trying to say here,is that,if it is possible to add a "Tab Control" (like what we see in excel) into the rdl..
|||The RDL is being rendered by the ReportView control and thus can't contain any WinForm or WebForm components. You may be able to simulate what you are wanting to do by using the hidden properties of items such as rectangles. For a wild example of what can be accomplished, take a look at the Etch A Sketch built by Brian Welcher http://blogs.msdn.com/bwelcker/archive/2005/10/29/486534.aspx(note: the report doesn't appear to be online anymore; download the source, it is well worth it)
If you post or send mock ups of what you are trying to do, I will try and help you build it.
Larry
|||I just cant download the source.And as for what you are saying,i had tried some tricks like that,but it seems that it is not very effective.One reason is that,if one sheet in any case is too long,then it will push my custom tab(compose of textboxes with navigation to subreports) to go beneaththe page which not supposed to be.But there is no way that you can make it fixed location right.But as what u said that i cannot add a winform,i may agree to that,thanks.But if you still had any other idea,i would be very greatful to hear that.Thank you so much..And by the way for you too see what i had done,i will send one of my form.If you just want to take a look..
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<BottomMargin>1in</BottomMargin>
<RightMargin>1in</RightMargin>
<rdrawGrid>true</rd
rawGrid>
<InteractiveWidth>8.5in</InteractiveWidth>
<rdnapToGrid>true</rd
napToGrid>
<Body>
<ReportItems>
<Textbox Name="textbox4">
<Left>2.375in</Left>
<ZIndex>5</ZIndex>
<Action>
<Drillthrough>
<ReportName>Sub1</ReportName>
</Drillthrough>
</Action>
<Width>1in</Width>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontWeight>700</FontWeight>
<BackgroundColor>LightGrey</BackgroundColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>Sheet 3</Value>
</Textbox>
<Textbox Name="textbox3">
<ZIndex>4</ZIndex>
<Action>
<Drillthrough>
<ReportName>Sub2</ReportName>
</Drillthrough>
</Action>
<Width>0.375in</Width>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontWeight>700</FontWeight>
<BackgroundColor>LightGrey</BackgroundColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value />
</Textbox>
<Rectangle Name="rectangle1">
<Left>3.375in</Left>
<ZIndex>3</ZIndex>
<Style>
<BackgroundColor>LightGrey</BackgroundColor>
</Style>
<Height>0.25in</Height>
</Rectangle>
<Textbox Name="textbox2">
<Left>1.375in</Left>
<ZIndex>2</ZIndex>
<Action>
<Drillthrough>
<ReportName>Sub2</ReportName>
</Drillthrough>
</Action>
<Width>1in</Width>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontWeight>700</FontWeight>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>Sheet 2</Value>
</Textbox>
<Textbox Name="textbox1">
<Left>0.375in</Left>
<rdefaultName>textbox1</rd
efaultName>
<ZIndex>1</ZIndex>
<Action>
<Drillthrough>
<ReportName>main</ReportName>
</Drillthrough>
</Action>
<Width>1.00041in</Width>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontWeight>700</FontWeight>
<BackgroundColor>LightGrey</BackgroundColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>Sheet 1</Value>
</Textbox>
<Image Name="image1">
<Sizing>Fit</Sizing>
<Left>0.375in</Left>
<Top>0.5in</Top>
<Width>7.375in</Width>
<Source>Embedded</Source>
<Style />
<Height>3.625in</Height>
<Value>exgraph</Value>
</Image>
</ReportItems>
<Height>4.25in</Height>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</Body>
<rd:ReportID>fd68b021-3677-4bda-94a8-cee7c9065a99</rd:ReportID>
<LeftMargin>1in</LeftMargin>
<EmbeddedImages>
<EmbeddedImage Name="exgraph">
<ImageData>I had removed the encrypted data for my picture..Maybe you can sub<ImageData>
<MIMEType>image/jpeg</MIMEType>
</EmbeddedImage>
</EmbeddedImages>
<Width>8.25083in</Width>
<InteractiveHeight>11in</InteractiveHeight>
<Language>en-US</Language>
<TopMargin>1in</TopMargin>
</Report>
Again,Thanks.... o_O
By the way,i hadn't notice,the one that i had sent to you was the one that i had placed my custom tab(as if it was,hehe) above the page.
|||Why do you need to do it this way? You could make 2 seperate reports, embed them in a HTML page and use some javascript to select different divs which changes between the reports... You also don't have to worry about printing issues/exporting with overlaid items...etc. You could even get fancy with some AJAX if you wanted! I dunno, if you can present a clear reason behind why you want to do it that way... But I kind of see it as:
Create tabs on a report...user might not view other tabs = all data must be loaded on report execution = longer load time = unhappy user
Anyways, I'd still be interested if you get it working if you do decide to pursue that path!
|||
Thanks Salvo0194, but honestly speaking,i am not familiar in User Interface because we are in a three - tier framework.And that is what they want me do to.But based on my research,there really is no way that i can try to put a tab control in a rdl.And based as what you had said,i think also that it could only be the best way to do the trick.Thank you so much.But still i am waiting for some other comments that will benefit all of us for certain issues..hehe.. By the way,thanks for reminding,no programmer wants a user to be ..hehe.. o_O
I found a good example at http://blogs.msdn.com/lukaszp/archive/2005/10/11/479791.aspx
but I built one just for you with 'tabs' that work the way I believe you want them. The tab body is a rectangle and the tab tops are text boxes. The tab tops link back to the same report with a parameter set that handles the visibility.
Here is the code:
Code Snippet
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinitionhttp://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition">http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition</A< A>>" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
'>http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
; <BottomMargin>1in</BottomMargin>
<RightMargin>1in</RightMargin>
<ReportParameters>
<ReportParameter Name="ToggleItem">
<DataType>Integer</DataType>
<DefaultValue>
<Values>
<Value>1</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>Report_Parameter_0</Prompt>
<Hidden>true</Hidden>
</ReportParameter>
</ReportParameters>
<rd:DrawGrid>true</rd:DrawGrid>
<InteractiveWidth>8.5in</InteractiveWidth>
<rd:SnapToGrid>true</rd:SnapToGrid>
<Body>
<ReportItems>
<Textbox Name="textbox6">
<Left>0.375in</Left>
<ZIndex>8</ZIndex>
<Width>1in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>=Code.IsHidden(1)</Value>
</Textbox>
<Textbox Name="textbox5">
<Left>1.375in</Left>
<ZIndex>7</ZIndex>
<Width>1in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>=Code.IsHidden(2)</Value>
</Textbox>
<Textbox Name="textbox4">
<Left>2.375in</Left>
<rd:DefaultName>textbox4</rd:DefaultName>
<ZIndex>6</ZIndex>
<Width>1in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>=Code.IsHidden(3)</Value>
</Textbox>
<Textbox Name="TabTop1">
<Left>0.375in</Left>
<Top>0.25in</Top>
<ZIndex>5</ZIndex>
<Action>
<Drillthrough>
<ReportName>Report1</ReportName>
<Parameters>
<Parameter Name="ToggleItem">
<Value>1</Value>
</Parameter>
</Parameters>
</Drillthrough>
</Action>
<Width>1in</Width>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<BackgroundColor>LemonChiffon</BackgroundColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>TabTop1</Value>
</Textbox>
<Textbox Name="TabTop2">
<Left>1.375in</Left>
<Top>0.25in</Top>
<ZIndex>4</ZIndex>
<Action>
<Drillthrough>
<ReportName>Report1</ReportName>
<Parameters>
<Parameter Name="ToggleItem">
<Value>2</Value>
</Parameter>
</Parameters>
</Drillthrough>
</Action>
<Width>1in</Width>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<BackgroundColor>LemonChiffon</BackgroundColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>TabTop2</Value>
</Textbox>
<Textbox Name="TabTop3">
<Left>2.375in</Left>
<Top>0.25in</Top>
<ZIndex>3</ZIndex>
<Action>
<Drillthrough>
<ReportName>Report1</ReportName>
<Parameters>
<Parameter Name="ToggleItem">
<Value>3</Value>
</Parameter>
</Parameters>
</Drillthrough>
</Action>
<Width>1in</Width>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<BackgroundColor>LemonChiffon</BackgroundColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>TabTop3</Value>
</Textbox>
<Rectangle Name="Tab1">
<Left>0.125in</Left>
<ReportItems>
<Textbox Name="textbox2">
<Left>0.375in</Left>
<Top>0.625in</Top>
<rd:DefaultName>textbox2</rd:DefaultName>
<Width>1in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>TabGuts1</Value>
</Textbox>
</ReportItems>
<Top>0.5in</Top>
<ZIndex>2</ZIndex>
<Visibility>
<Hidden>=Code.IsHidden(1)</Hidden>
</Visibility>
<Width>6.25in</Width>
<Style>
<BackgroundColor>LemonChiffon</BackgroundColor>
</Style>
<Height>1.375in</Height>
</Rectangle>
<Rectangle Name="Tab2">
<Left>0.125in</Left>
<ReportItems>
<Textbox Name="textbox3">
<Left>0.875in</Left>
<Top>0.75in</Top>
<Width>1in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>TabGuts2</Value>
</Textbox>
</ReportItems>
<Top>0.5in</Top>
<ZIndex>1</ZIndex>
<Visibility>
<Hidden>=Code.IsHidden(2)</Hidden>
</Visibility>
<Width>6.25in</Width>
<Style>
<BackgroundColor>LemonChiffon</BackgroundColor>
</Style>
<Height>1.375in</Height>
</Rectangle>
<Rectangle Name="Tab3">
<Left>0.125in</Left>
<ReportItems>
<Textbox Name="textbox1">
<Left>0.875in</Left>
<Top>0.5in</Top>
<Width>1in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>TabGuts3</Value>
</Textbox>
</ReportItems>
<Top>0.5in</Top>
<Visibility>
<Hidden>=Code.IsHidden(3)</Hidden>
</Visibility>
<Width>6.25in</Width>
<Style>
<BackgroundColor>LemonChiffon</BackgroundColor>
</Style>
<Height>1.375in</Height>
</Rectangle>
</ReportItems>
<Height>3.625in</Height>
</Body>
<rd:ReportID>c853717f-f8cb-4fff-8177-c8c9c3f5548b</rd:ReportID>
<LeftMargin>1in</LeftMargin>
<Code>Function IsHidden(ByVal currentTab As Integer) As Boolean
If Not currentTab = Report.Parameters!ToggleItem.Value Then
Return True
Else
Return False
End If
End Function</Code>
<Width>9.75in</Width>
<InteractiveHeight>11in</InteractiveHeight>
<Language>en-US</Language>
<TopMargin>1in</TopMargin>
</Report>
Larry thanx for the code.Funny we almost had the similar trick,but yours is nicer..hehe..uhm that finished it up..Maybe thats the only thing that we can do.But there only is one issue,uhm i dont know if you had just forgotten it,or what,but by th way,the rectangles are overlapping and it will give the user a warning,which is not good,uhm..but still thanks for that reply.It clears up thing now.But if still,you have a solution about overlapping,it is still greatly accepted(hehe..too much of me)..but maybe it would also be useful to others.Thank You o_O
|||Sorry about that, simply stack them vertically and the rendering engine should reclaim the space if they are not visible. I didn't see the warning on mine.|||
Ok..thanks so much for the great help..
No comments:
Post a Comment