Friday, March 9, 2012
EXPORT TO PDF - double lines won't export
if you set the borderstyle for any cell to double, when you export to
PDF, it appears as a single line. Is there a work-around for this,
aside from a adding another row? These are pretty complicated reports,
and I don't want the added overhead of managing the visibility of a row
I added just to get a double line.
This should be simple. Any ideas?what a great group. Answers for everyone. Boy, Microsoft really has
this all under control. Just like the Bush administration, everyone is
so busy counting their money that there's no time for the little guy...
Wednesday, March 7, 2012
Export To Excel, CSV, XML with expression in Hidden property omits data
I have a matrix table with a rectangle in the data cell. The rectangle has an image and textbox. The textbox has an expression in it's Hidden property based on the column name. The report renders fine on screen. When the report is exported to Excel, CSV, XML the textbox contents are not output (the images display as expected). I've tried setting the DataElementOutput to Output/Yes with no success. Exporting to TIFF, PDF, Web Archive/MTHML is fine.
Here is a sample RDL which exhibits the issue:
<?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="Gemini50DataSource">
<DataSourceReference>Gemini50DataSource</DataSourceReference>
<rdataSourceID>bb03313c-48a4-4e40-af99-ed584847ca20</rd
ataSourceID>
</DataSource>
</DataSources>
<BottomMargin>1in</BottomMargin>
<RightMargin>1in</RightMargin>
<ReportParameters>
<ReportParameter Name="ImagePath">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>c:\</Value>
</Values>
</DefaultValue>
<Prompt>Image Path</Prompt>
</ReportParameter>
</ReportParameters>
<rdrawGrid>true</rd
rawGrid>
<InteractiveWidth>8.5in</InteractiveWidth>
<rdnapToGrid>true</rd
napToGrid>
<Body>
<ReportItems>
<Matrix Name="matrix1">
<MatrixColumns>
<MatrixColumn>
<Width>3.75in</Width>
</MatrixColumn>
</MatrixColumns>
<RowGroupings>
<RowGrouping>
<Width>1.75in</Width>
<DynamicRows>
<ReportItems>
<Textbox Name="PicIndex">
<rdefaultName>PicIndex</rd
efaultName>
<ZIndex>1</ZIndex>
<Style>
<TextAlign>Right</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!PicIndex.Value</Value>
</Textbox>
</ReportItems>
<Grouping Name="matrix1_PicIndex">
<GroupExpressions>
<GroupExpression>=Fields!PicIndex.Value</GroupExpression>
</GroupExpressions>
</Grouping>
</DynamicRows>
</RowGrouping>
</RowGroupings>
<ColumnGroupings>
<ColumnGrouping>
<DynamicColumns>
<ReportItems>
<Textbox Name="ColumnName">
<rdefaultName>ColumnName</rd
efaultName>
<ZIndex>2</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<BackgroundColor>LightBlue</BackgroundColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Fields!ColumnName.Value</Value>
</Textbox>
</ReportItems>
<Grouping Name="matrix1_ColumnName">
<GroupExpressions>
<GroupExpression>=Fields!ColumnName.Value</GroupExpression>
</GroupExpressions>
</Grouping>
</DynamicColumns>
<Height>0.25in</Height>
</ColumnGrouping>
</ColumnGroupings>
<DataSetName>DataSet2</DataSetName>
<Width>5.5in</Width>
<Corner>
<ReportItems>
<Textbox Name="textbox1">
<rdefaultName>textbox1</rd
efaultName>
<ZIndex>3</ZIndex>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</Corner>
<Height>0.55208in</Height>
<MatrixRows>
<MatrixRow>
<Height>0.30208in</Height>
<MatrixCells>
<MatrixCell>
<ReportItems>
<Rectangle Name="rectangle1">
<ReportItems>
<Image Name="image1">
<Sizing>AutoSize</Sizing>
<Left>0.25in</Left>
<MIMEType />
<ZIndex>1</ZIndex>
<Visibility>
<Hidden>=IIF(First(Fields!ColumnName.Value = "image"), Len(Fields!CellValue.Value)=0, true)</Hidden>
</Visibility>
<Width>0.3in</Width>
<Source>External</Source>
<Style />
<Value>="file:" + Parameters!ImagePath.Value + Fields!CellValue.Value</Value>
</Image>
<Textbox Name="textbox2">
<Left>1.625in</Left>
<DataElementOutput>Output</DataElementOutput>
<rdefaultName>textbox2</rd
efaultName>
<Visibility>
<Hidden>=IIF(Fields!ColumnName.Value <> "image", False, True)</Hidden>
</Visibility>
<Width>1.875in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<BackgroundColor>PeachPuff</BackgroundColor>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.25in</Height>
<Value>=Fields!CellValue.Value</Value>
</Textbox>
</ReportItems>
<Visibility>
<Hidden>=IIF(True, False, True)</Hidden>
</Visibility>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<BackgroundColor>LightGrey</BackgroundColor>
</Style>
</Rectangle>
</ReportItems>
</MatrixCell>
</MatrixCells>
</MatrixRow>
</MatrixRows>
</Matrix>
</ReportItems>
<Height>0.625in</Height>
</Body>
<rd:ReportID>a944d20c-558a-4805-9d4c-aecc9757f678</rd:ReportID>
<LeftMargin>1in</LeftMargin>
<DataSets>
<DataSet Name="DataSet2">
<Query>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
<CommandText>SELECT 1 as PicIndex, 'image' as ColumnName, 'image1.jpg' as CellValue
union
SELECT 2,'image','image2.jpg'
union
SELECT 3,'image','image3.jpg'
union
SELECT 4,'image',null
union
SELECT 5,'something else',null
union
SELECT 6,'another column', 'display my text!'</CommandText>
<DataSourceName>Gemini50DataSource</DataSourceName>
</Query>
<Fields>
<Field Name="PicIndex">
<rd:TypeName>System.Int32</rd:TypeName>
<DataField>PicIndex</DataField>
</Field>
<Field Name="ColumnName">
<rd:TypeName>System.String</rd:TypeName>
<DataField>ColumnName</DataField>
</Field>
<Field Name="CellValue">
<rd:TypeName>System.String</rd:TypeName>
<DataField>CellValue</DataField>
</Field>
</Fields>
</DataSet>
</DataSets>
<Width>5.625in</Width>
<InteractiveHeight>11in</InteractiveHeight>
<Language>en-US</Language>
<TopMargin>1in</TopMargin>
</Report>
Here is a posting related to this that may help.
http://blogs.msdn.com/bimusings/archive/2007/02/07/reporting-services-why-aren-t-all-my-report-columns-exporting-to-csv-and-or-xml.aspx
cheers,
Andrew
|||Andrew,
Thanks for the posting. I've seen that blog. Unfortunately, the "good news" wasn't so good for this case. The setting of DataElementOutput(yes, no, auto) has no effect on the output for the situation described . If you find any other possibilities I would very much appreciate it.
Thanks,
Brian
Sunday, February 26, 2012
export to excel has merged cell problem
merged.
For example, I have report as following
ID Project Name Author Description
1 xxxx dfdf fdfdfdfd
after export in the excel, the data shows correctly, but on the top of the
excel file, it may show something like this
A B C D E F
ID Project Name Author Description
1 xxxx dfdf fdfdfdfd
The problem is some of the columns has one column data but excel treat them
as two columns.
Does anyone have any idea? thanks.The Excel renderer will merge cells in order to preserve the report item
alignment you defined when you designed the report.
Merging usually happens when there are report items either below or above
the table whose left or right edges do not exactly match that of the table
cells below.
A classic example of this is a single textbox above a table that functions
as a header. Make sure this textbox starts and ends at the border of one of
the below table's cells.
Best,
-Chris
SQL Server Reporting Services
"Helen" <Helen@.discussions.microsoft.com> wrote in message
news:8EDC7FB7-BC51-473E-A29B-4CDB47E9C4F4@.microsoft.com...
>I have noticed that after my report exported to excel, some of the cells
>are
> merged.
> For example, I have report as following
> ID Project Name Author Description
> 1 xxxx dfdf fdfdfdfd
> after export in the excel, the data shows correctly, but on the top of the
> excel file, it may show something like this
> A B C D E F
> ID Project Name Author Description
> 1 xxxx dfdf fdfdfdfd
> The problem is some of the columns has one column data but excel treat
> them
> as two columns.
> Does anyone have any idea? thanks.
>
Friday, February 24, 2012
Export to Excel - Number formatted cells export to Excel as 'General' ?
Anyone know why cells within a matrix that are formatted as numeric export to Excel with a cell format proprty of "General"? Cells within a table however export with an appropriate format.
Thanks
Try converting the data within the cell - something like cdbl() or cint() may work.