Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Sunday, March 11, 2012

cumulative totals in chart : Report Builder

Hi,

I am trying to display a line chart with cumulative totals over period of 12 months in a fiscal year. I know this can be achieveable in report designer using "Running value function".

Any idea how to achieve the same in Report builder ?

thanks in advance.

Here is the data :

Month Count

July 2

Aug 3

Sept 2

Expected output should be

Month Count

July 2

Aug 5(July count + Aug.Count)

Sept 7(July count + Aug count + Sept Count)

Regards,

bala

Hi guys,

Any idea how to achieve the above functionality in Report Builder ?

Saturday, February 25, 2012

cube measures on rows in reporting services....

Is there anyway for reporting services to display measures on rows instead
of columns as in Excel?
I'm trying to format my data in rows but this doesn't seems possible in
reporting services... does anyone has any examples of how this can be done?Create a shared datasource to Foodmart 200 and try this RDL. HEre is a sample
report that i created with measures on rows.
<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition"
xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Textbox Name="textbox1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Times New Roman</FontFamily>
<BackgroundColor>Brown</BackgroundColor>
<BorderWidth>
<Bottom>3pt</Bottom>
</BorderWidth>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<FontSize>18pt</FontSize>
<TextAlign>Center</TextAlign>
<Color>White</Color>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>1</ZIndex>
<rd:DefaultName>textbox1</rd:DefaultName>
<Height>0.33in</Height>
<CanGrow>true</CanGrow>
<Value>Report20</Value>
</Textbox>
<Matrix Name="matrix1">
<Corner>
<ReportItems>
<Textbox Name="textbox4">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>5</ZIndex>
<rd:DefaultName>textbox4</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</Corner>
<Height>0.72in</Height>
<Style />
<MatrixRows>
<MatrixRow>
<MatrixCells>
<MatrixCell>
<ReportItems>
<Textbox Name="textbox2">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<rd:DefaultName>textbox2</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=First(Fields!Measures_Unit_Sales.Value)</Value>
</Textbox>
</ReportItems>
</MatrixCell>
</MatrixCells>
<Height>0.24in</Height>
</MatrixRow>
<MatrixRow>
<MatrixCells>
<MatrixCell>
<ReportItems>
<Textbox Name="textbox3">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<rd:DefaultName>textbox3</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=First(Fields!Measures_Profit.Value)</Value>
</Textbox>
</ReportItems>
</MatrixCell>
</MatrixCells>
<Height>0.24in</Height>
</MatrixRow>
</MatrixRows>
<MatrixColumns>
<MatrixColumn>
<Width>1in</Width>
</MatrixColumn>
</MatrixColumns>
<DataSetName>FoodMart_2000</DataSetName>
<ColumnGroupings>
<ColumnGrouping>
<DynamicColumns>
<Grouping Name="matrix1_Customers_Country">
<GroupExpressions>
<GroupExpression>=Fields!Customers_Country.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Sorting>
<SortBy>
<SortExpression>=Fields!Customers_Country.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
<ReportItems>
<Textbox Name="Customers_Country">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Times New Roman</FontFamily>
<FontSize>12pt</FontSize>
<Color>DarkRed</Color>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>4</ZIndex>
<rd:DefaultName>Customers_Country</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!Customers_Country.Value</Value>
</Textbox>
</ReportItems>
</DynamicColumns>
<Height>0.24in</Height>
</ColumnGrouping>
</ColumnGroupings>
<Width>2in</Width>
<Top>0.33in</Top>
<RowGroupings>
<RowGrouping>
<Width>1in</Width>
<StaticRows>
<StaticRow>
<ReportItems>
<Textbox Name="textbox7">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Times New Roman</FontFamily>
<FontSize>12pt</FontSize>
<Color>DarkRed</Color>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>3</ZIndex>
<rd:DefaultName>textbox7</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Units</Value>
</Textbox>
</ReportItems>
</StaticRow>
<StaticRow>
<ReportItems>
<Textbox Name="textbox8">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Times New Roman</FontFamily>
<FontSize>12pt</FontSize>
<Color>DarkRed</Color>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>1</ZIndex>
<rd:DefaultName>textbox8</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Profit</Value>
</Textbox>
</ReportItems>
</StaticRow>
</StaticRows>
</RowGrouping>
</RowGroupings>
</Matrix>
</ReportItems>
<Style />
<Height>2.25in</Height>
</Body>
<TopMargin>1in</TopMargin>
<DataSources>
<DataSource Name="FoodMart 2000">
<DataSourceReference>FoodMart 2000</DataSourceReference>
</DataSource>
</DataSources>
<Width>5in</Width>
<DataSets>
<DataSet Name="FoodMart_2000">
<Fields>
<Field Name="Customers_Country">
<DataField>[Customers].[Country].[MEMBER_CAPTION]</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Measures_Unit_Sales">
<DataField>[Measures].[Unit Sales]</DataField>
<rd:TypeName>System.Object</rd:TypeName>
</Field>
<Field Name="Measures_Profit">
<DataField>[Measures].[Profit]</DataField>
<rd:TypeName>System.Object</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>FoodMart 2000</DataSourceName>
<CommandText>select
{{[Customers].[Country].Members}}on rows,
{ [Measures].[Unit Sales],[Measures].[Profit]} on columns
from Sales</CommandText>
</Query>
</DataSet>
</DataSets>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<BottomMargin>1in</BottomMargin>
<Language>en-US</Language>
</Report>
"Nestor" wrote:
> Is there anyway for reporting services to display measures on rows instead
> of columns as in Excel?
> I'm trying to format my data in rows but this doesn't seems possible in
> reporting services... does anyone has any examples of how this can be done?
>
>

cube design question (beginner)

Hi,

Let's say that i have a fact table with sales and one time dimension and i want to display the count of sales over the bands of sales; something like this:

0-750 750-1000 1000-1250

2004 1 12 5

2005 0 9 11

2006 2 13 40

Any sugestion ?

i suggest you create a dimension of this fact table, and create an attribute with the sales measure and use the DiscretizationBucketCount and DiscretizationMethod to configure the bands.

hope this helps

Friday, February 17, 2012

CSV exporting issue

Hi,

I have a simple report with a table and 3 columns. I have used only the detail row of the table to display data from a simple dataset that has a stored procedure as the data source.

When I export it to CSV format, the names of the textboxes that are in the table column also gets exported in the first row. Is there a way to suppress this?

I have already tried setting DataElementOutput = NoOutput for the table and the textboxes but nothing works. Please do not give me the link of an earlier thread on the same topic because that doesnt provide the answer.

I have also tried setting DeviceInfo parameters in RSReportDesigner.config and rsreportserver.config (NoHeader=true) but none of them work even after restarting the machine and SQL Reporting Service.

If there is a way or an alternative, please let me know.

Thanks,

Shyam

There is another issue with CSV exporting.

I want every field to be wrapped around double quotes, so I have handled that in the SQL query itself. When I export to CSV, it adds 4 more double quotes to every field which means every field has 6 double quotes around it (3 to the left and 3 to the right). I also tried handling it in the report by appending Chr(34) and an explicit double quote in the field expression but all of them seem to give the same stupid result (6 double quotes).

Is there a way to work around this problem in SQL Reporting services?

It's very frustrating.

Shyam

|||

Thanks everybody for not responding. Hope it works on another machine.

Shyam

CSV exporting issue

Hi,

I have a simple report with a table and 3 columns. I have used only the detail row of the table to display data from a simple dataset that has a stored procedure as the data source.

When I export it to CSV format, the names of the textboxes that are in the table column also gets exported in the first row. Is there a way to suppress this?

I have already tried setting DataElementOutput = NoOutput for the table and the textboxes but nothing works. Please do not give me the link of an earlier thread on the same topic because that doesnt provide the answer.

I have also tried setting DeviceInfo parameters in RSReportDesigner.config and rsreportserver.config (NoHeader=true) but none of them work even after restarting the machine and SQL Reporting Service.

If there is a way or an alternative, please let me know.

Thanks,

Shyam

There is another issue with CSV exporting.

I want every field to be wrapped around double quotes, so I have handled that in the SQL query itself. When I export to CSV, it adds 4 more double quotes to every field which means every field has 6 double quotes around it (3 to the left and 3 to the right). I also tried handling it in the report by appending Chr(34) and an explicit double quote in the field expression but all of them seem to give the same stupid result (6 double quotes).

Is there a way to work around this problem in SQL Reporting services?

It's very frustrating.

Shyam

|||

Thanks everybody for not responding. Hope it works on another machine.

Shyam

CSV export with single quotations for string fields

Hi

I need to export data to CSV file from Sql Reporting Services.

I am including single quotations in my view to display in SRS for string fields.

After export if we open in Notepad, for string field it is adding multiple quotations.

How to add single quotations for string fields - CSV files,

Please let me know if anybody knows.

Thx

Vijji

Yes. You can specify this value (it's called the "Qualifier") for the CSV renderer -- see http://msdn2.microsoft.com/en-us/library/ms155365.aspx

-- and I believe you can set the default for the value in the rsreportserver.config file as well -- see http://msdn2.microsoft.com/en-us/library/ms156281.aspx

>L<

|||

Hi Lisa Nicholls

Thank you so much for the response,

I changed in the config file as below

<Extension Name="CSV" Type="Microsoft.ReportingServices.Rendering.CsvRenderer.CsvReport,Microsoft.ReportingServices.CsvRendering">
<Configuration>
<DeviceInfo>
<Encoding>ASCII</Encoding>
<NoHeader>True</NoHeader>
<Qualifier>False</Qualifier>
</DeviceInfo>
</Configuration>
</Extension>

It is working fine.

I have another issue, any suggestions will be very helpful.

In my data string field having comma, while importing it is treating as seperate column.

How do we control with in the string comma values.

Thank you again

Vijji

|||

hi there,

This is on the same page of the docs I've already sent you to <s>. Use a different value for FieldDelimiter along with Qualifier, if your data contains a comma.

(Actually I think that they got the terms backwards -- it should be that the item for which the RS default is a comma is termed a "Field Separator" and the item for which the RS default is quotation mark is called the "Field Delimiter" -- but you get the idea <s>.)

HTH,

>L<

Tuesday, February 14, 2012

CrystalReports in VB6

Hello,

I want to display a Crystalreport in VB6.
When i develop a Crystalreport a form is added with the following ocde:

Dim Report As New CrystalReport1

Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault

End Sub

Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth

There is a parameter which should be sended to this report in order to collect to correct recordset from our SQLserver.
The Fieldname is CrystalReport1.Field1

Does anyone know how to do this?

Hope to hear from anyone.

Thanks in advance,
XanderPublic Sub CreateNewViewerWithParametersForDateAndDept(SelectionFormula As String, ReportPath As String, sStartDate As String, sStopDate As String, sDept As String, SingleDate As Boolean)

On Error GoTo CreateNewViewerError


Dim miReport As CRAXDDRT.Report
Dim miCRApp As New CRAXDDRT.Application
Dim DBTable As CRAXDRT.DatabaseTable
Set miReport = miCRApp.OpenReport(ReportPath)
Dim sDataBasePath As String

sDataBasePath = App.Path & "\Commercial.mdb"
Dim ConnectionInfo As CRAXDRT.ConnectionProperties
'Set the Connection Info to Connection Properties of the table object
Set ConnectionInfo = miReport.Database.Tables(1).ConnectionProperties
'Clear the ConnectionProperties collection.
ConnectionInfo.DeleteAll
'Add the database used by the report
ConnectionInfo.Add "Database Name", sDataBasePath
Set DBTable = miReport.Database.Tables(1)
DBTable.Location = sDataBasePath
With miReport
If (Len(SelectionFormula) > 0) Then
.RecordSelectionFormula = SelectionFormula
End If
If Not (SingleDate) Then
.ParameterFields(2).AddCurrentRange CDate(sStartDate), CDate(sStopDate), crRangeIncludeLowerBound + crRangeIncludeUpperBound
Else
.ParameterFields(2).AddCurrentValue CDate(sStartDate)
End If
.ParameterFields(4).AddCurrentValue (sDept)
If Not (ReportTitle = Empty) Then
.Sections("PH").ReportObjects("SummaryOfPayPeriod").SetText ReportTitle
End If
.Sections("PH").ReportObjects("Department").SetText "Dept." & sDept
End With
With ENG.crvCommercial
.ReportSource = miReport
.ViewReport
.DisplayGroupTree = False
.EnableProgressControl = True
While .IsBusy
DoEvents
Wend
.Zoom "100"
.Visible = True
End With
Set miCRApp = Nothing
Set miReport = Nothing
ENG.chkIndiviual.Value = 0 'Make sure that the Print command is cleared
ENG.MousePointer = vbDefault
Exit Sub
CreateNewViewerError:
MsgBox Err.Description, vbInformation, "Error"
Set miCRApp = Nothing
Set miReport = Nothing
ENG.chkIndiviual.Value = 0 'Make sure that the Print command is cleared
ENG.MousePointer = vbDefault

End Sub

LEGEND:
CreateNew Viewer With Parameters For Date And Dept
SelectionFormula As String = Created Selection formula.
ReportPath As String = Where and what report you want to use.
sStartDate As String = Start Date of selection.
sStopDate As String = Ending Date of selection
sDept As String = What Department
SingleDate As Boolean = Is only a single date required.

I use this function to create a viewer for my reports based on certain paramters that are selected by the user. This function is a part of a program that I wrote for the company that I work for. It will track TimeSheets for technicians and create reports based on the data. This program is in VB6 SP6 and Crystal 9.|||This should work:

Report.ParameterFields(1).AddCurrentValue (Value)

the number between () is the index (first one is 1, second 2,....)
in "Value" you have to put the value of the parameter field.