Showing posts with label example. Show all posts
Showing posts with label example. Show all posts

Friday, March 30, 2012

Hide label if no data

Hi all,
is it possible to hide a textbox (a normal label) if in the adiacent cell
there is no data in tha dataset? (for example a null value).
Thanks a lot.
--
Luigi
http://blogs.dotnethell.it/ciupaz/Yes it is. You can add this expression in your text box;
iif(Fields!TextBoxData.Value <0, Fields!TextBox.Value, nothing)
"Luigi" wrote:
> Hi all,
> is it possible to hide a textbox (a normal label) if in the adiacent cell
> there is no data in tha dataset? (for example a null value).
> Thanks a lot.
> --
> Luigi
> http://blogs.dotnethell.it/ciupaz/

Hide folder in Report Manager

Hi All,

How to hide a folder in Report Manager? For Example, I don't want to show the DataSource Folder in the Report Manager.

TIA

Hi TIA,

You can hide the datasource folder by going to properties(general tab) of the folder and check "Hide in list view".

- Kranthi

|||

Thank you Kranthi,

But I still can see that folder, is that because I am an Administrator?

Wednesday, March 28, 2012

Hide dimension member in AS Cube Edit

Hi,
Is any way to hide dimension member in AS Cube Edit?
For example, I have "A", "B", "C" and "sum1", "sum2" these 5 members in the
same dimension,
sum1 = A + B
sum2 = B + C
So, I just want the Cube Edit show "sum1" and "sum2" these 2 members,
Is any way can do this?
Thanks for your time!
AngiUse "Hide Member If" advanced property of a level in the properties pane of
Dimension Editor (if the dimension is shared) or Cube Editor (if the
dimension is private). Properties are at the bottom of the left pane of
Analysis Manager.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com
"angi" <angi@.microsoft.com> wrote in message
news:usi3WuHlEHA.3648@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Is any way to hide dimension member in AS Cube Edit?
> For example, I have "A", "B", "C" and "sum1", "sum2" these 5 members in
the
> same dimension,
> sum1 = A + B
> sum2 = B + C
> So, I just want the Cube Edit show "sum1" and "sum2" these 2 members,
> Is any way can do this?
> Thanks for your time!
>
> Angi
>

Hide dimension member in AS Cube Edit

Hi,
Is any way to hide dimension member in AS Cube Edit?
For example, I have "A", "B", "C" and "sum1", "sum2" these 5 members in the
same dimension,
sum1 = A + B
sum2 = B + C
So, I just want the Cube Edit show "sum1" and "sum2" these 2 members,
Is any way can do this?
Thanks for your time!
Angi
Use "Hide Member If" advanced property of a level in the properties pane of
Dimension Editor (if the dimension is shared) or Cube Editor (if the
dimension is private). Properties are at the bottom of the left pane of
Analysis Manager.
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com
"angi" <angi@.microsoft.com> wrote in message
news:usi3WuHlEHA.3648@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Is any way to hide dimension member in AS Cube Edit?
> For example, I have "A", "B", "C" and "sum1", "sum2" these 5 members in
the
> same dimension,
> sum1 = A + B
> sum2 = B + C
> So, I just want the Cube Edit show "sum1" and "sum2" these 2 members,
> Is any way can do this?
> Thanks for your time!
>
> Angi
>

Monday, March 26, 2012

Hide a Row or Column in Detail but show in Subtotal

It there a way I can hide a ROW in detail but show subtotal.
Example
c1 c2 c3 c4 Total
Project Task1 Actual 8 7 6 4 25
Schedule 8 8 8 8 32
Task2 Actual 2 2 2 2 8
Schedule 3 3 3 3 12
Total Project Actual 10 9 8 6 33
Schedule 11 11 11 11 44
Difference -1 -2 -3 -5 -11
Difference is the Row not in Task Group but I want difference to show in
subtotal. Is there a way to hide whole row on detial but show in Subtotal. I
tried Inscope. I can get blank row in detail and difference in subtotal. But
it does takes whole row space for each task. I am trying to hide the ROW
somehow to minimize the space.
c1 c2 c3 c4 Total
Project Task1 Actual 8 7 6 4 25
Schedule 8 8 8 8 32
Task2 Actual 2 2 2 2 8
Schedule 3 3 3 3 12
Total Project Actual 10 9 8 6 33
Schedule 11 11 11 11 44
Difference -1 -2 -3 -5 -11
Thanks for response
--
Gaurav Wason
gwason@.gmail.com
MCP - Project Server
Project Made Easy
Project Archive Tool
Project Owner Tool
http://projectmadeeasy.comOn Mar 19, 9:40 pm, Gaurav Wason <gwa...@.gmail.com> wrote:
> It there a way I can hide a ROW in detail but show subtotal.
> Example
> c1 c2 c3 c4 Total
> Project Task1 Actual 8 7 6 4 25
> Schedule 8 8 8 8 32
> Task2 Actual 2 2 2 2 8
> Schedule 3 3 3 3 12
> Total Project Actual 10 9 8 6 33
> Schedule 11 11 11 11 44
> Difference -1 -2 -3 -5 -11
> Difference is the Row not in Task Group but I want difference to show in
> subtotal. Is there a way to hide whole row on detial but show in Subtotal. I
> tried Inscope. I can get blank row in detail and difference in subtotal. But
> it does takes whole row space for each task. I am trying to hide the ROW
> somehow to minimize the space.
> c1 c2 c3 c4 Total
> Project Task1 Actual 8 7 6 4 25
> Schedule 8 8 8 8 32
> Task2 Actual 2 2 2 2 8
> Schedule 3 3 3 3 12
> Total Project Actual 10 9 8 6 33
> Schedule 11 11 11 11 44
> Difference -1 -2 -3 -5 -11
> Thanks for response
> --
> Gaurav Wason
> gwa...@.gmail.com
> MCP - Project Server
> Project Made Easy
> Project Archive Tool
> Project Owner Toolhttp://projectmadeeasy.com
As far as I know there is not a way around this: particularly, if you
are doing the Difference as part of the table. You might, however, try
doing the difference either in the stored procedure or query that is
sourcing the report and include it in a separate textbox below the
table -or- use a separate text box below the table and include an
expression there that includes an aggregate with a reference to the
dataset (or reference to a separate dataset that determines the
difference). Hope this helps.
Regards,
Enrique Martinez
Sr. SQL Server Developer

Friday, March 23, 2012

hidden cell in excel

Hello,

Can someone please tell me why there's ALWAYS a hidden cell in Excel when a report has a more than one page?

for example, a report has 10 page breaks and after exported to Excel it has the first row hidden in each sheet except the first sheet.

Why this happens always? is there any workaround to avoid this?

thanks

I also have the same questions as the original poster.

How does one get rid of the hidden row in an exported Excel spreadsheet when there are page breaks in the report?

Thanks in advance.

|||

Hey Guys.

Can you clarify this a little more? I have exported my reports to excel but I get one long continuous sheet even when my report has multiple pages.

I have notice however that excel does include your report page margins, So I'm taking a guess that this could be what you're seeing in your export.

Ham

|||

Hey Ham,

Yes, one long continuous sheet in Excel, but the page breaks are there in the report definition for viewing via the Report Manager web site. We (independently, the OP and I) think that somehow the page breaks are influencing the "hidden row" phenomenon.

The hidden row presents itself in the exported Excel spreadsheet on "Sheet 2", where "Sheet 1" was the parameter detail information. If one inspects Sheet 2 (which is the actual data produced by the report), one would see that row 1 is hidden (perhaps a better word is collapsed; one can expand it by double clicking on the row separator in the left margin-ish area), row 2 contains the header row/column headings, then row 3 and beyond contain the actual data.

Our report users don't like that hidden row 1. I know that it would be easy to expand and then remove it in Excel but....you know users, they don't want it there from the get-go.

Thanks for any advice.

John

|||

Hi,

Can it be that you are using Document Maps in your report? It might be that it are document maps that you see.

Greetz,

Geert

Geert Verhoeven
Consultant @. Ausy Belgium

My Personal Blog

|||

Hi Geert,

Although I didn't build the reports myself, I spoke with the author, and inspected the layout view (and RDL), and we are NOT using Document Maps.

Might there be another reason for the "hidden row" issue with exported Excel reports?

John

|||

Hi John,

It is hard to say like that. Can you please mail or post the contents of the RDL file so I can take a look at it.

Greetz,

Geert

Geert Verhoeven
Consultant @. Ausy Belgium

My Personal Blog

|||

Here is the RDL. I took the majority of lines associated with a BMP image. Thanks for taking 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">
<DataSources>
<DataSource Name="dsKnetch">
<DataSourceReference>dsKnetch</DataSourceReference>
<rd:DataSourceID>42d0feab-c2ad-4306-b39a-0993cc80c5f8</rd:DataSourceID>
</DataSource>
</DataSources>
<BottomMargin>0.5in</BottomMargin>
<RightMargin>0.5in</RightMargin>
<PageWidth>11in</PageWidth>
<ReportParameters>
<ReportParameter Name="StartDtRange">
<DataType>DateTime</DataType>
<Prompt>Start of Date Range</Prompt>
</ReportParameter>
<ReportParameter Name="EndDtRange">
<DataType>DateTime</DataType>
<Prompt>End of Date Range</Prompt>
</ReportParameter>
<ReportParameter Name="Title">
<DataType>String</DataType>
<Prompt>Title Starts With</Prompt>
</ReportParameter>
</ReportParameters>
<rd:DrawGrid>true</rd:DrawGrid>
<InteractiveWidth>8.5in</InteractiveWidth>
<rd:SnapToGrid>true</rd:SnapToGrid>
<Body>
<ReportItems>
<Image Name="image1">
<Sizing>FitProportional</Sizing>
<ZIndex>5</ZIndex>
<Source>Embedded</Source>
<Style />
<Height>0.375in</Height>
<Value>knetch</Value>
</Image>
<Textbox Name="textbox38">
<Top>0.75in</Top>
<rd:DefaultName>textbox38</rd:DefaultName>
<ZIndex>4</ZIndex>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>12pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>Knetch - Crosscheck Report (by Title &amp; Date)</Value>
</Textbox>
<Textbox Name="textbox37">
<Top>0.375in</Top>
<rd:DefaultName>textbox37</rd:DefaultName>
<ZIndex>3</ZIndex>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>12pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>Company</Value>
</Textbox>
<Rectangle Name="rectangle1">
<ReportItems>
<Textbox Name="textbox55">
<Left>1.5in</Left>
<Top>0.125in</Top>
<rd:DefaultName>textbox55</rd:DefaultName>
<ZIndex>3</ZIndex>
<Width>8.375in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.2in</Height>
<Value>=Parameters!Title.Value</Value>
</Textbox>
<Textbox Name="textbox28">
<Left>0.125in</Left>
<Top>0.125in</Top>
<ZIndex>2</ZIndex>
<Width>1.25in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.2in</Height>
<Value>Title Starts With:</Value>
</Textbox>
<Textbox Name="textbox2">
<Left>0.125in</Left>
<Top>0.375in</Top>
<ZIndex>1</ZIndex>
<Width>1.25in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.2in</Height>
<Value>Class(es) Date Range:</Value>
</Textbox>
<Textbox Name="textbox3">
<Left>1.5in</Left>
<Top>0.375in</Top>
<Width>8.375in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.2in</Height>
<Value>=Parameters!StartDtRange.Value &amp; " to " &amp; Parameters!EndDtRange.Value</Value>
</Textbox>
</ReportItems>
<Top>1.375in</Top>
<ZIndex>2</ZIndex>
<PageBreakAtEnd>true</PageBreakAtEnd>
<Height>0.625in</Height>
</Rectangle>
<Textbox Name="textbox54">
<Top>1.125in</Top>
<ZIndex>1</ZIndex>
<Width>2.75in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.2in</Height>
<Value>Self Service Filter Options:</Value>
</Textbox>
<Table Name="table1">
<DataSetName>dsDisvantageCrosscheck</DataSetName>
<Top>2.125in</Top>
<Width>9.925in</Width>
<Details>
<TableRows>
<TableRow>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox4">
<rd:DefaultName>textbox4</rd:DefaultName>
<ZIndex>5</ZIndex>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!username.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox5">
<rd:DefaultName>textbox5</rd:DefaultName>
<ZIndex>4</ZIndex>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!employee_name.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox6">
<rd:DefaultName>textbox6</rd:DefaultName>
<ZIndex>3</ZIndex>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!office_name.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox8">
<rd:DefaultName>textbox8</rd:DefaultName>
<ZIndex>2</ZIndex>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!class_no.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox12">
<rd:DefaultName>textbox12</rd:DefaultName>
<ZIndex>1</ZIndex>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<Format>MM/dd/yy</Format>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!start_date.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox10">
<rd:DefaultName>textbox10</rd:DefaultName>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<Format>MM/dd/yy</Format>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!end_date.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
<Height>0.2in</Height>
</TableRow>
</TableRows>
<Grouping Name="table1_Details_Group">
<GroupExpressions>
<GroupExpression>=Fields!username.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Sorting>
<SortBy>
<SortExpression>=Fields!employee_name.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
<SortBy>
<SortExpression>=Fields!start_date.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
<SortBy>
<SortExpression>=Fields!end_date.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
</Details>
<Header>
<TableRows>
<TableRow>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox29">
<ZIndex>11</ZIndex>
<Style>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Bottom>1pt</Bottom>
</BorderWidth>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Username</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox30">
<ZIndex>10</ZIndex>
<Style>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Bottom>1pt</Bottom>
</BorderWidth>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Participant Name</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox31">
<ZIndex>9</ZIndex>
<Style>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Bottom>1pt</Bottom>
</BorderWidth>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Office</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox32">
<ZIndex>8</ZIndex>
<Style>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Bottom>1pt</Bottom>
</BorderWidth>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Class Number</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox33">
<ZIndex>7</ZIndex>
<Style>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Bottom>1pt</Bottom>
</BorderWidth>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Start Date</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox34">
<ZIndex>6</ZIndex>
<Style>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Bottom>1pt</Bottom>
</BorderWidth>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>End Date</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
<Height>0.25in</Height>
</TableRow>
</TableRows>
<RepeatOnNewPage>true</RepeatOnNewPage>
</Header>
<TableColumns>
<TableColumn>
<Width>1.5in</Width>
</TableColumn>
<TableColumn>
<Width>2.5in</Width>
</TableColumn>
<TableColumn>
<Width>3.125in</Width>
</TableColumn>
<TableColumn>
<Width>1in</Width>
</TableColumn>
<TableColumn>
<Width>0.9in</Width>
</TableColumn>
<TableColumn>
<Width>0.9in</Width>
</TableColumn>
</TableColumns>
<Height>0.45in</Height>
</Table>
</ReportItems>
<Height>2.75in</Height>
</Body>
<rd:ReportID>a8221bfa-83bd-4bbb-9054-09ad45a8dcad</rd:ReportID>
<LeftMargin>0.5in</LeftMargin>
<EmbeddedImages>
<EmbeddedImage Name="knetch">
<ImageData>Qk1atAA////</ImageData>
<MIMEType>image/bmp</MIMEType>
</EmbeddedImage>
</EmbeddedImages>
<DataSets>
<DataSet Name="dsDisCrosscheck">
<Query>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
<CommandType>StoredProcedure</CommandType>
<CommandText>rpt.up_get_class_attend_crosscheck_title_date</CommandText>
<QueryParameters>
<QueryParameter Name="@.Title">
<Value>=Parameters!Title.Value</Value>
</QueryParameter>
<QueryParameter Name="@.StartDtRange">
<Value>=Parameters!StartDtRange.Value</Value>
</QueryParameter>
<QueryParameter Name="@.EndDtRange">
<Value>=Parameters!EndDtRange.Value</Value>
</QueryParameter>
</QueryParameters>
<DataSourceName>dsKnetch</DataSourceName>
</Query>
<Fields>
<Field Name="reg_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>reg_id</DataField>
</Field>
<Field Name="class_no">
<rd:TypeName>System.String</rd:TypeName>
<DataField>class_no</DataField>
</Field>
<Field Name="course_no">
<rd:TypeName>System.String</rd:TypeName>
<DataField>course_no</DataField>
</Field>
<Field Name="course_title">
<rd:TypeName>System.String</rd:TypeName>
<DataField>course_title</DataField>
</Field>
<Field Name="course_type">
<rd:TypeName>System.String</rd:TypeName>
<DataField>course_type</DataField>
</Field>
<Field Name="function">
<rd:TypeName>System.String</rd:TypeName>
<DataField>function</DataField>
</Field>
<Field Name="start_date">
<rd:TypeName>System.DateTime</rd:TypeName>
<DataField>start_date</DataField>
</Field>
<Field Name="end_date">
<rd:TypeName>System.DateTime</rd:TypeName>
<DataField>end_date</DataField>
</Field>
<Field Name="credit_point">
<rd:TypeName>System.Decimal</rd:TypeName>
<DataField>credit_point</DataField>
</Field>
<Field Name="student_count">
<rd:TypeName>System.Decimal</rd:TypeName>
<DataField>student_count</DataField>
</Field>
<Field Name="peoplesoft_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>peoplesoft_id</DataField>
</Field>
<Field Name="username">
<rd:TypeName>System.String</rd:TypeName>
<DataField>username</DataField>
</Field>
<Field Name="employee_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>employee_name</DataField>
</Field>
<Field Name="reg_status">
<rd:TypeName>System.String</rd:TypeName>
<DataField>reg_status</DataField>
</Field>
<Field Name="text_status">
<rd:TypeName>System.String</rd:TypeName>
<DataField>text_status</DataField>
</Field>
<Field Name="loc_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>loc_name</DataField>
</Field>
<Field Name="office_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>office_name</DataField>
</Field>
<Field Name="office_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>office_id</DataField>
</Field>
<Field Name="area_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>area_name</DataField>
</Field>
<Field Name="area_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>area_id</DataField>
</Field>
<Field Name="product_id_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>product_id_name</DataField>
</Field>
<Field Name="product_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>product_id</DataField>
</Field>
<Field Name="segment_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>segment_name</DataField>
</Field>
<Field Name="segment_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>segment_id</DataField>
</Field>
<Field Name="service_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>service_name</DataField>
</Field>
<Field Name="service_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>service_id</DataField>
</Field>
<Field Name="bu_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>bu_name</DataField>
</Field>
<Field Name="bu_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>bu_id</DataField>
</Field>
<Field Name="process_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>process_name</DataField>
</Field>
<Field Name="process_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>process_id</DataField>
</Field>
<Field Name="job_type">
<rd:TypeName>System.String</rd:TypeName>
<DataField>job_type</DataField>
</Field>
</Fields>
</DataSet>
</DataSets>
<Author>Cll (Consultant)</Author>
<Code>public function IsDup(byval currentUsername as string, byref previousUsername as object) as string
dim result as string = "False"
if (currentUsername = previousUsername.Value)
result = "True"
else
previousUsername.Value = currentUsername
end if
IsDup = result
end function</Code>
<Width>10in</Width>
<InteractiveHeight>11in</InteractiveHeight>
<Description>This report returns a list of learners who have registration statuses of Open-Normal or Open-Confirmed for the title(s) and date range(s) specified. It provides the learner’s username, name and office. This report is used to crosscheck learners enrolled in Knetch and learners with a hotel reservation for the particular class or classes.</Description>
<Language>en-US</Language>
<PageFooter>
<ReportItems>
<Textbox Name="textbox16">
<Top>0.03125in</Top>
<rd:DefaultName>textbox16</rd:DefaultName>
<ZIndex>2</ZIndex>
<Width>1.25in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>6pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.1875in</Height>
<Value>="Page " &amp; Globals!PageNumber &amp; " of " &amp; Globals!TotalPages</Value>
</Textbox>
<Textbox Name="textbox18">
<Left>1.375in</Left>
<Top>0.03125in</Top>
<ZIndex>1</ZIndex>
<Width>6.9375in</Width>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>6pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.1875in</Height>
<Value>="? " &amp; DateTime.Now.Year &amp;</Value>
</Textbox>
<Textbox Name="textbox19">
<Left>8.375in</Left>
<Top>0.03125in</Top>
<Width>1.5625in</Width>
<Style>
<TextAlign>Right</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>6pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.1875in</Height>
<Value>="Run Date/Time: " &amp; DateTime.Now</Value>
</Textbox>
</ReportItems>
<Height>0.25in</Height>
<PrintOnLastPage>true</PrintOnLastPage>
<PrintOnFirstPage>true</PrintOnFirstPage>
</PageFooter>
<TopMargin>0.5in</TopMargin>
<PageHeight>8.5in</PageHeight>
</Report>

|||Did anyone ever find the solution to this problem? I am also having this of using page breaks, and in Excel every sheet except sheet 1 has row 1 minimized.sql

hidden cell in excel

Hello,

Can someone please tell me why there's ALWAYS a hidden cell in Excel when a report has a more than one page?

for example, a report has 10 page breaks and after exported to Excel it has the first row hidden in each sheet except the first sheet.

Why this happens always? is there any workaround to avoid this?

thanks

I also have the same questions as the original poster.

How does one get rid of the hidden row in an exported Excel spreadsheet when there are page breaks in the report?

Thanks in advance.

|||

Hey Guys.

Can you clarify this a little more? I have exported my reports to excel but I get one long continuous sheet even when my report has multiple pages.

I have notice however that excel does include your report page margins, So I'm taking a guess that this could be what you're seeing in your export.

Ham

|||

Hey Ham,

Yes, one long continuous sheet in Excel, but the page breaks are there in the report definition for viewing via the Report Manager web site. We (independently, the OP and I) think that somehow the page breaks are influencing the "hidden row" phenomenon.

The hidden row presents itself in the exported Excel spreadsheet on "Sheet 2", where "Sheet 1" was the parameter detail information. If one inspects Sheet 2 (which is the actual data produced by the report), one would see that row 1 is hidden (perhaps a better word is collapsed; one can expand it by double clicking on the row separator in the left margin-ish area), row 2 contains the header row/column headings, then row 3 and beyond contain the actual data.

Our report users don't like that hidden row 1. I know that it would be easy to expand and then remove it in Excel but....you know users, they don't want it there from the get-go.

Thanks for any advice.

John

|||

Hi,

Can it be that you are using Document Maps in your report? It might be that it are document maps that you see.

Greetz,

Geert

Geert Verhoeven
Consultant @. Ausy Belgium

My Personal Blog

|||

Hi Geert,

Although I didn't build the reports myself, I spoke with the author, and inspected the layout view (and RDL), and we are NOT using Document Maps.

Might there be another reason for the "hidden row" issue with exported Excel reports?

John

|||

Hi John,

It is hard to say like that. Can you please mail or post the contents of the RDL file so I can take a look at it.

Greetz,

Geert

Geert Verhoeven
Consultant @. Ausy Belgium

My Personal Blog

|||

Here is the RDL. I took the majority of lines associated with a BMP image. Thanks for taking 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">
<DataSources>
<DataSource Name="dsKnetch">
<DataSourceReference>dsKnetch</DataSourceReference>
<rd:DataSourceID>42d0feab-c2ad-4306-b39a-0993cc80c5f8</rd:DataSourceID>
</DataSource>
</DataSources>
<BottomMargin>0.5in</BottomMargin>
<RightMargin>0.5in</RightMargin>
<PageWidth>11in</PageWidth>
<ReportParameters>
<ReportParameter Name="StartDtRange">
<DataType>DateTime</DataType>
<Prompt>Start of Date Range</Prompt>
</ReportParameter>
<ReportParameter Name="EndDtRange">
<DataType>DateTime</DataType>
<Prompt>End of Date Range</Prompt>
</ReportParameter>
<ReportParameter Name="Title">
<DataType>String</DataType>
<Prompt>Title Starts With</Prompt>
</ReportParameter>
</ReportParameters>
<rd:DrawGrid>true</rd:DrawGrid>
<InteractiveWidth>8.5in</InteractiveWidth>
<rd:SnapToGrid>true</rd:SnapToGrid>
<Body>
<ReportItems>
<Image Name="image1">
<Sizing>FitProportional</Sizing>
<ZIndex>5</ZIndex>
<Source>Embedded</Source>
<Style />
<Height>0.375in</Height>
<Value>knetch</Value>
</Image>
<Textbox Name="textbox38">
<Top>0.75in</Top>
<rd:DefaultName>textbox38</rd:DefaultName>
<ZIndex>4</ZIndex>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>12pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>Knetch - Crosscheck Report (by Title &amp; Date)</Value>
</Textbox>
<Textbox Name="textbox37">
<Top>0.375in</Top>
<rd:DefaultName>textbox37</rd:DefaultName>
<ZIndex>3</ZIndex>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>12pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>Company</Value>
</Textbox>
<Rectangle Name="rectangle1">
<ReportItems>
<Textbox Name="textbox55">
<Left>1.5in</Left>
<Top>0.125in</Top>
<rd:DefaultName>textbox55</rd:DefaultName>
<ZIndex>3</ZIndex>
<Width>8.375in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.2in</Height>
<Value>=Parameters!Title.Value</Value>
</Textbox>
<Textbox Name="textbox28">
<Left>0.125in</Left>
<Top>0.125in</Top>
<ZIndex>2</ZIndex>
<Width>1.25in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.2in</Height>
<Value>Title Starts With:</Value>
</Textbox>
<Textbox Name="textbox2">
<Left>0.125in</Left>
<Top>0.375in</Top>
<ZIndex>1</ZIndex>
<Width>1.25in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.2in</Height>
<Value>Class(es) Date Range:</Value>
</Textbox>
<Textbox Name="textbox3">
<Left>1.5in</Left>
<Top>0.375in</Top>
<Width>8.375in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.2in</Height>
<Value>=Parameters!StartDtRange.Value &amp; " to " &amp; Parameters!EndDtRange.Value</Value>
</Textbox>
</ReportItems>
<Top>1.375in</Top>
<ZIndex>2</ZIndex>
<PageBreakAtEnd>true</PageBreakAtEnd>
<Height>0.625in</Height>
</Rectangle>
<Textbox Name="textbox54">
<Top>1.125in</Top>
<ZIndex>1</ZIndex>
<Width>2.75in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.2in</Height>
<Value>Self Service Filter Options:</Value>
</Textbox>
<Table Name="table1">
<DataSetName>dsDisvantageCrosscheck</DataSetName>
<Top>2.125in</Top>
<Width>9.925in</Width>
<Details>
<TableRows>
<TableRow>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox4">
<rd:DefaultName>textbox4</rd:DefaultName>
<ZIndex>5</ZIndex>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!username.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox5">
<rd:DefaultName>textbox5</rd:DefaultName>
<ZIndex>4</ZIndex>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!employee_name.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox6">
<rd:DefaultName>textbox6</rd:DefaultName>
<ZIndex>3</ZIndex>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!office_name.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox8">
<rd:DefaultName>textbox8</rd:DefaultName>
<ZIndex>2</ZIndex>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!class_no.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox12">
<rd:DefaultName>textbox12</rd:DefaultName>
<ZIndex>1</ZIndex>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<Format>MM/dd/yy</Format>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!start_date.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox10">
<rd:DefaultName>textbox10</rd:DefaultName>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
<Format>MM/dd/yy</Format>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!end_date.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
<Height>0.2in</Height>
</TableRow>
</TableRows>
<Grouping Name="table1_Details_Group">
<GroupExpressions>
<GroupExpression>=Fields!username.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Sorting>
<SortBy>
<SortExpression>=Fields!employee_name.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
<SortBy>
<SortExpression>=Fields!start_date.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
<SortBy>
<SortExpression>=Fields!end_date.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
</Details>
<Header>
<TableRows>
<TableRow>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox29">
<ZIndex>11</ZIndex>
<Style>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Bottom>1pt</Bottom>
</BorderWidth>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Username</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox30">
<ZIndex>10</ZIndex>
<Style>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Bottom>1pt</Bottom>
</BorderWidth>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Participant Name</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox31">
<ZIndex>9</ZIndex>
<Style>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Bottom>1pt</Bottom>
</BorderWidth>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Office</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox32">
<ZIndex>8</ZIndex>
<Style>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Bottom>1pt</Bottom>
</BorderWidth>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Class Number</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox33">
<ZIndex>7</ZIndex>
<Style>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Bottom>1pt</Bottom>
</BorderWidth>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>Start Date</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox34">
<ZIndex>6</ZIndex>
<Style>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<BorderWidth>
<Bottom>1pt</Bottom>
</BorderWidth>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontWeight>700</FontWeight>
<FontSize>9pt</FontSize>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>End Date</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
<Height>0.25in</Height>
</TableRow>
</TableRows>
<RepeatOnNewPage>true</RepeatOnNewPage>
</Header>
<TableColumns>
<TableColumn>
<Width>1.5in</Width>
</TableColumn>
<TableColumn>
<Width>2.5in</Width>
</TableColumn>
<TableColumn>
<Width>3.125in</Width>
</TableColumn>
<TableColumn>
<Width>1in</Width>
</TableColumn>
<TableColumn>
<Width>0.9in</Width>
</TableColumn>
<TableColumn>
<Width>0.9in</Width>
</TableColumn>
</TableColumns>
<Height>0.45in</Height>
</Table>
</ReportItems>
<Height>2.75in</Height>
</Body>
<rd:ReportID>a8221bfa-83bd-4bbb-9054-09ad45a8dcad</rd:ReportID>
<LeftMargin>0.5in</LeftMargin>
<EmbeddedImages>
<EmbeddedImage Name="knetch">
<ImageData>Qk1atAA////</ImageData>
<MIMEType>image/bmp</MIMEType>
</EmbeddedImage>
</EmbeddedImages>
<DataSets>
<DataSet Name="dsDisCrosscheck">
<Query>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
<CommandType>StoredProcedure</CommandType>
<CommandText>rpt.up_get_class_attend_crosscheck_title_date</CommandText>
<QueryParameters>
<QueryParameter Name="@.Title">
<Value>=Parameters!Title.Value</Value>
</QueryParameter>
<QueryParameter Name="@.StartDtRange">
<Value>=Parameters!StartDtRange.Value</Value>
</QueryParameter>
<QueryParameter Name="@.EndDtRange">
<Value>=Parameters!EndDtRange.Value</Value>
</QueryParameter>
</QueryParameters>
<DataSourceName>dsKnetch</DataSourceName>
</Query>
<Fields>
<Field Name="reg_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>reg_id</DataField>
</Field>
<Field Name="class_no">
<rd:TypeName>System.String</rd:TypeName>
<DataField>class_no</DataField>
</Field>
<Field Name="course_no">
<rd:TypeName>System.String</rd:TypeName>
<DataField>course_no</DataField>
</Field>
<Field Name="course_title">
<rd:TypeName>System.String</rd:TypeName>
<DataField>course_title</DataField>
</Field>
<Field Name="course_type">
<rd:TypeName>System.String</rd:TypeName>
<DataField>course_type</DataField>
</Field>
<Field Name="function">
<rd:TypeName>System.String</rd:TypeName>
<DataField>function</DataField>
</Field>
<Field Name="start_date">
<rd:TypeName>System.DateTime</rd:TypeName>
<DataField>start_date</DataField>
</Field>
<Field Name="end_date">
<rd:TypeName>System.DateTime</rd:TypeName>
<DataField>end_date</DataField>
</Field>
<Field Name="credit_point">
<rd:TypeName>System.Decimal</rd:TypeName>
<DataField>credit_point</DataField>
</Field>
<Field Name="student_count">
<rd:TypeName>System.Decimal</rd:TypeName>
<DataField>student_count</DataField>
</Field>
<Field Name="peoplesoft_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>peoplesoft_id</DataField>
</Field>
<Field Name="username">
<rd:TypeName>System.String</rd:TypeName>
<DataField>username</DataField>
</Field>
<Field Name="employee_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>employee_name</DataField>
</Field>
<Field Name="reg_status">
<rd:TypeName>System.String</rd:TypeName>
<DataField>reg_status</DataField>
</Field>
<Field Name="text_status">
<rd:TypeName>System.String</rd:TypeName>
<DataField>text_status</DataField>
</Field>
<Field Name="loc_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>loc_name</DataField>
</Field>
<Field Name="office_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>office_name</DataField>
</Field>
<Field Name="office_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>office_id</DataField>
</Field>
<Field Name="area_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>area_name</DataField>
</Field>
<Field Name="area_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>area_id</DataField>
</Field>
<Field Name="product_id_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>product_id_name</DataField>
</Field>
<Field Name="product_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>product_id</DataField>
</Field>
<Field Name="segment_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>segment_name</DataField>
</Field>
<Field Name="segment_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>segment_id</DataField>
</Field>
<Field Name="service_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>service_name</DataField>
</Field>
<Field Name="service_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>service_id</DataField>
</Field>
<Field Name="bu_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>bu_name</DataField>
</Field>
<Field Name="bu_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>bu_id</DataField>
</Field>
<Field Name="process_name">
<rd:TypeName>System.String</rd:TypeName>
<DataField>process_name</DataField>
</Field>
<Field Name="process_id">
<rd:TypeName>System.String</rd:TypeName>
<DataField>process_id</DataField>
</Field>
<Field Name="job_type">
<rd:TypeName>System.String</rd:TypeName>
<DataField>job_type</DataField>
</Field>
</Fields>
</DataSet>
</DataSets>
<Author>Cll (Consultant)</Author>
<Code>public function IsDup(byval currentUsername as string, byref previousUsername as object) as string
dim result as string = "False"
if (currentUsername = previousUsername.Value)
result = "True"
else
previousUsername.Value = currentUsername
end if
IsDup = result
end function</Code>
<Width>10in</Width>
<InteractiveHeight>11in</InteractiveHeight>
<Description>This report returns a list of learners who have registration statuses of Open-Normal or Open-Confirmed for the title(s) and date range(s) specified. It provides the learner’s username, name and office. This report is used to crosscheck learners enrolled in Knetch and learners with a hotel reservation for the particular class or classes.</Description>
<Language>en-US</Language>
<PageFooter>
<ReportItems>
<Textbox Name="textbox16">
<Top>0.03125in</Top>
<rd:DefaultName>textbox16</rd:DefaultName>
<ZIndex>2</ZIndex>
<Width>1.25in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>6pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.1875in</Height>
<Value>="Page " &amp; Globals!PageNumber &amp; " of " &amp; Globals!TotalPages</Value>
</Textbox>
<Textbox Name="textbox18">
<Left>1.375in</Left>
<Top>0.03125in</Top>
<ZIndex>1</ZIndex>
<Width>6.9375in</Width>
<Style>
<TextAlign>Center</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>6pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.1875in</Height>
<Value>="? " &amp; DateTime.Now.Year &amp;</Value>
</Textbox>
<Textbox Name="textbox19">
<Left>8.375in</Left>
<Top>0.03125in</Top>
<Width>1.5625in</Width>
<Style>
<TextAlign>Right</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<FontFamily>Times New Roman</FontFamily>
<FontSize>6pt</FontSize>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.1875in</Height>
<Value>="Run Date/Time: " &amp; DateTime.Now</Value>
</Textbox>
</ReportItems>
<Height>0.25in</Height>
<PrintOnLastPage>true</PrintOnLastPage>
<PrintOnFirstPage>true</PrintOnFirstPage>
</PageFooter>
<TopMargin>0.5in</TopMargin>
<PageHeight>8.5in</PageHeight>
</Report>

Wednesday, March 21, 2012

hi their

Hi

just i need to know how are we concatenate select statement if we have more if condition in side the strode procedure.

as a example

ssql = 'select * from pat'

and i have more selection criteria

whet i need to do is
if (@.pct is not null)
begin
ssql = ssql +' , '+ 'where pct_cd = @.pct
end

any idea

thank you
Niranga

Code Snippet

declare @.sql nvarchar(4000),

@.pct numeric(5,4)

set @.sql =N'SELECT fld1, fld2 FROM table'

if @.pct isnotnull

begin

set @.sql = @.sql +' where pct_cd = '+cast(@.pct asnvarchar(20))

end

execsp_executesql @.sql

|||thank you very much daleJ|||

No problem Niranga.

If that is a satisfactory solution, please mark it as an answer.

|||HI

It's working properly and when I'm executing it says Command(s) completed successfully. but now the problem is not gain any output is there a specific way to execute it.|||

Nope.

Just execute sp_executesql.

Make sure your query returns rows when executed without using the stored procedure to invoke it.

sql

Monday, March 12, 2012

Hepl with a stored procedure

I want to write a stored procedure that takes two params and merges records
whose id match the two params.
For example, I have a TableX(col1 char(10), col2 char(5), col3 int) with 4
rows:
"c1"," i2", 3
"c1", "i4", 2
"d1", "i2", 2
"d1", "i3", 1
After I call the sp and pass "c1" and "d1" as arguments, the table should
contains only 3 rows:
"d1", "i2", 5
"d1", "i3", 1
"d1", "i4", 2
Note: the sp should also take into account that only records with "c1" id
are guaranteed to exist in the table but the records with "d1" is are not.
I could use two cursors to fetch records that match the given col1
arguemtns, do some comparison as I step through the cursors, write the
results into a temp table, drop the records in TableX, and finally select
records from temp table into TableX.
I think there must be an elegant & efficient way that uses only subqueries
and maybe a Table variable. Could any one help me with this?.... a complex (or simple) update statement that has the same logic as your
query.
I'd most likely use executeSQL within my sProc that allows output params fro
m an
exec string to do further validation processing
Then start a transaction, first do the update and then the delete then close
the
transaction.
I would also be concerned about record locks if users are in these same tabl
es
during this update/merge.
HTH
JeffP....
"VC" <vutha@.mailblocks.com> wrote in message
news:eAM7%238tEFHA.464@.TK2MSFTNGP15.phx.gbl...
> I want to write a stored procedure that takes two params and merges record
s
> whose id match the two params.
> For example, I have a TableX(col1 char(10), col2 char(5), col3 int) with 4
> rows:
> "c1"," i2", 3
> "c1", "i4", 2
> "d1", "i2", 2
> "d1", "i3", 1
> After I call the sp and pass "c1" and "d1" as arguments, the table should
> contains only 3 rows:
> "d1", "i2", 5
> "d1", "i3", 1
> "d1", "i4", 2
> Note: the sp should also take into account that only records with "c1" id
> are guaranteed to exist in the table but the records with "d1" is are not.
> I could use two cursors to fetch records that match the given col1
> arguemtns, do some comparison as I step through the cursors, write the
> results into a temp table, drop the records in TableX, and finally select
> records from temp table into TableX.
> I think there must be an elegant & efficient way that uses only subqueries
> and maybe a Table variable. Could any one help me with this?
>|||On Mon, 14 Feb 2005 14:49:28 -0700, VC wrote:

>I want to write a stored procedure that takes two params and merges records
>whose id match the two params.
>For example, I have a TableX(col1 char(10), col2 char(5), col3 int) with 4
>rows:
>"c1"," i2", 3
>"c1", "i4", 2
>"d1", "i2", 2
>"d1", "i3", 1
> After I call the sp and pass "c1" and "d1" as arguments, the table should
>contains only 3 rows:
>"d1", "i2", 5
>"d1", "i3", 1
>"d1", "i4", 2
>Note: the sp should also take into account that only records with "c1" id
>are guaranteed to exist in the table but the records with "d1" is are not.
Hi VC,
This can be done with three queries. Your sp should enclose them in a
procedure and add proper error handling.
-- Handle c1 without matching d1
-- (these are simply "renamed" to d1)
UPDATE c
SET col1 = 'd1'
FROM TableX AS c
LEFT JOIN TableX AS d
ON d.col1 = 'd1'
AND d.col2 = c.col2
WHERE c.col1 = 'c1'
-- Handle c1 with matching d1
-- (col3 in the d1 row gets increased; the c1 row is left unchanged)
UPDATE d
SET col3 = d.col3 + c.col3
FROM TableX AS c
INNER JOIN TableX AS d
ON d.col1 = 'd1'
AND d.col2 = c.col2
WHERE c.col1 = 'c1'
-- Remove remaining c1 rows
DELETE TableX
WHERE col1 = 'c1'
(untested)
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Thank for the suggestion of using the transaction to protect the db
intergrity in case of errors. In my case, record locks should not be a
problem because col1 contains guid variables that are supposed to be
uniquely created for a user session. So the operation would affect, if any,
just a few rows that belong to one user.
BTW, check out the solution provided by Hugo Kornelis. It is much more
efficient than the one I had in mind.
"JDP@.Work" <JPGMTNoSpam@.sbcglobal.net> wrote in message
news:%23QhIYQuEFHA.1396@.tk2msftngp13.phx.gbl...
> ... a complex (or simple) update statement that has the same logic as
> your
> query.
> I'd most likely use executeSQL within my sProc that allows output params
> from an
> exec string to do further validation processing
> Then start a transaction, first do the update and then the delete then
> close the
> transaction.
> I would also be concerned about record locks if users are in these same
> tables
> during this update/merge.
> HTH
> JeffP....
> "VC" <vutha@.mailblocks.com> wrote in message
> news:eAM7%238tEFHA.464@.TK2MSFTNGP15.phx.gbl...
>|||Your solution works nicely. I just make a small change to your block of code
so that only rows with unmatched col2 are renamed.
UPDATE c
SET col1 = 'd1'
FROM T1 AS c
WHERE c.col1 = 'c1'
AND c.col2 NOT IN
(SELECT d.col2 FROM T1 AS d
WHERE d.col1 = 'd1')
Thank you very much. I now only need to create a sp out of these codes :)
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:aib2111n1uigknubv8kk4c1lmk1j0qc02m@.
4ax.com...
> On Mon, 14 Feb 2005 14:49:28 -0700, VC wrote:
>
> Hi VC,
> This can be done with three queries. Your sp should enclose them in a
> procedure and add proper error handling.
> -- Handle c1 without matching d1
> -- (these are simply "renamed" to d1)
> UPDATE c
> SET col1 = 'd1'
> FROM TableX AS c
> LEFT JOIN TableX AS d
> ON d.col1 = 'd1'
> AND d.col2 = c.col2
> WHERE c.col1 = 'c1'
> -- Handle c1 with matching d1
> -- (col3 in the d1 row gets increased; the c1 row is left unchanged)
> UPDATE d
> SET col3 = d.col3 + c.col3
> FROM TableX AS c
> INNER JOIN TableX AS d
> ON d.col1 = 'd1'
> AND d.col2 = c.col2
> WHERE c.col1 = 'c1'
> -- Remove remaining c1 rows
> DELETE TableX
> WHERE col1 = 'c1'
> (untested)
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)|||On Tue, 15 Feb 2005 11:54:58 -0700, VC wrote:

>Your solution works nicely. I just make a small change to your block of cod
e
>so that only rows with unmatched col2 are renamed.
>UPDATE c
>SET col1 = 'd1'
>FROM T1 AS c
>WHERE c.col1 = 'c1'
>AND c.col2 NOT IN
> (SELECT d.col2 FROM T1 AS d
> WHERE d.col1 = 'd1')
Hi VC,
This statement is actually equivalent to the statement I intened to use,
but I now see that I forgot to include one important line. This is the
statement as I meant it to write:
UPDATE c
SET col1 = 'd1'
FROM TableX AS c
LEFT JOIN TableX AS d
ON d.col1 = 'd1'
AND d.col2 = c.col2
WHERE c.col1 = 'c1'
AND d.col1 IS NULL -- This line is added
The extra line is there to test that the LEFT JOIN did not find a matching
row in TableX.
The main advantage of my version over yours is that NOT IN will produce
unexpected results if any of the rows in your table can have a NULL value
for col2. That's why I always use either the LEFT JOIN technique, or a
subquery with EXISTS.
Of course, the problem with the LEFT JOIN technique is that it goes
dramatically wrong if you forget to include the IS NULL test... <g>
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

Friday, March 9, 2012

HelpTotals within Totals

I have a report with say two fields, market, amount. I need a report to present like this, but to do totals after line item presentation...example report looks like this. Question is, how do I do the totals part seperate from the line items??

Market amount
-- --
Texas 10.00
Texas 20.00
Texas 30.00
Boston 10.00
Boston 20.00
Boston 90.00

Totals Texas 60.00
Totals Boston 120.00You can set it up like the following by adding a Group on Market and adding a Running Total Field which Sums Amount to the Group Footer.

Market amount
-- --
Texas 10.00
Texas 20.00
Texas 30.00

Totals Texas 60.00

Boston 10.00
Boston 20.00
Boston 90.00

Totals Boston 120.00

- or -

If you know what Market is going to be, you can set up Formula Fields with the following Formula:

NumberVar intTotal
IF {Market} = 'Texas' THEN
NumberVar := NumberVar + {Amount}

- or -

There's a Formula that looks like: Sum(fld, condFld, cond). I have never used it, but I assume you can set it up simialr to:

Sum ( {Amount}, {Market}, 'Texas' )

(I didn't test this code, so you may have to tweak it a bit to work out any bugs.)|||Thanks malleyo but there's a subtle difference in the report...the footer has and entries for each market. The list of markets is dynamic (a group by field)...thus, option 1 and 2-3 aren't quite it...I have a feeling I have to use subreports.

Let me know if you have any other thoughts and thanks for your help.|||Hi Mallego
How to sum amount large than 10 ?|||ReportDude,
I guess you are right there is no option otherthan subreport, I had the same issue before and I used sub report.
But if you find better solution other than SubReport please post the solution.

Thanks,
Gragi

Wednesday, March 7, 2012

Help: Table name displaying twice in SQL Statement inside SQL Server Enterprise Manager

For some reason whenever I look at the SQL statement of a particular table, the table name displays twice.
For example,
SELECT * FROM State State
Even when I execute this statement, it still returns the correct results. It does this for all tables in this particular database. I also check another database and thoses display the table names in the SQL statements correctly.
Does anyone know why the table name would display twice in a table inside of a particular database?

How (where) are these statements being generated? All this is doing is creating an alias for the table with its own name, so this won't hurt anything. It's much like doing:
SELECT A.Field1 FROM State A
Marcie|||

datagridgirl wrote:

How (where) are these statements being generated? All this is doing is creating an alias for the table with its own name, so this won't hurt anything. It's much like doing:
SELECT A.Field1 FROM State A
Marcie


It just came up whenever I look at the SQL statement (SQL Pane) after "Returning All Rows" of a particular table. I guess it is not a big deal. I just don't know why it would do that.|||

voodoo9055 wrote:

It just came up whenever I look at the SQL statement (SQL Pane) after "Returning All Rows" of a particular table. I guess it is not a big deal. I just don't know why it would do that.


I'm curious now...in what tool? I'm not seeing this behavior in either VS.NET (via Server Explorer) or Enterprise Manager...
Marcie|||

datagridgirl wrote:

voodoo9055 wrote:

It just came up whenever I look at the SQL statement (SQL Pane) after "Returning All Rows" of a particular table. I guess it is not a big deal. I just don't know why it would do that.


I'm curious now...in what tool? I'm not seeing this behavior in either VS.NET (via Server Explorer) or Enterprise Manager...
Marcie


Enterprise Manager.
It displays that way for one of my databases. The rest display normally.

Friday, February 24, 2012

Help: Join few records in a same field and same database table.

Hi guys,

I need urgent help here. How to join few records in a same field and same database table. For example:

id sequence_no itemcode description
1 1 APP Apple
1 2 BNN Banana
2 1 ORG Orange

What is the sql query that will return row as follow:

id description
1 Apple Banana
2 Orange

Thank you in advance guys...

hi, you can try this

-- create a function
CREATE FUNCTION dbo.GetFruitSequence
(
@.id int
)
RETURNS varchar(100)
AS
BEGIN
DECLARE @.FruitSequence varchar(100)
SET @.FruitSequence = ''

SELECT @.FruitSequence = @.FruitSequence + [description] + ', '
FROM Fruits
WHERE [id] = @.id
ORDER BY
[sequence_no]

IF @.FruitSequence <> '' SET @.FruitSequence = LEFT(@.FruitSequence, LEN(@.FruitSequence) - 1)

RETURN @.FruitSequence

END

GO

-- to use the function
SELECT DISTINCT [id]
, dbo.GetFruitSequence([id]) as [description]
FROM Fruits
ORDER BY
[id]

GO|||Thank you Rhamille|||

You can use the following query in SQL Server 2005

Code Snippet

Create Table #itemdata (

[id] int ,

[sequence_no] int ,

[itemcode] Varchar(100) ,

[description] Varchar(100)

);

Insert Into #itemdata Values('1','1','APP','Apple');

Insert Into #itemdata Values('1','2','BNN','Banana');

Insert Into #itemdata Values('2','1','ORG','Orange');

Select

id

,(Select [description] + ' ' as [text()] From #itemdata as Sub Where Sub.id=Main.id For XML Path(''), ELEMENTS) as List

From

#itemdata as Main