Showing posts with label x-axis. Show all posts
Showing posts with label x-axis. Show all posts

Wednesday, March 7, 2012

chart-simple line x-axis

How is it possible to have the values on the chart x-axis to be shown vertically rather than horizantal?
Thanks

I dont find any option to do that. actually coming to real time when the number of values on x axis is more,the values will be shown vertically.

Is that acceptable? or you want your values all the time printed vertically

Thank you,

Raj Deep.A

|||

I just tested your comments.

You are right.

I think I will go with the default for now.

Many thanks

Saturday, February 25, 2012

Charts - too much data - possible to break up into 2 charts

If the user is reporting on a lot of information then the line chart/graph
in the report contains too much data and the X-Axis labels just look like
one big blob because all of the item labels are squeezed together too
tightly.
Has anyone found a way to say for example... If there are more than X number
of items on the X Axis in the chart then to split the chart into 2 charts.
The second chart would appear directly beneath the 1st chart. This way the
user would be able to telll what the data is they are looking at.
This seems to be a common problem in all charting situations and the
solution usually is just filtering on less data. I don't see why we have to
tell the user to filter on less data and run multiple reports. It seems
possible that en enterprise reporting application like RS should have this
capability... or... the capability to code it in the report.
Any ideas?There is no perfect solution for this. Some ideas:
* You could use filters and multiple charts and use conditional visibility
to hide unneeded charts
* Group the data and use drillthrough reports with charts showing the
details per group
* If you use a bar chart visualization instead of line chart, you could use
a table with groupings. In the group header you would add a chart. The more
data you have in the dataset, the more groups you get and the more chart
bars are drawn. A sample for this approach is copied to the bottom of this
posting.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"D Witherspoon" <dwitherspoon@.noway.org> wrote in message
news:elaCN4ivFHA.2008@.TK2MSFTNGP10.phx.gbl...
> If the user is reporting on a lot of information then the line chart/graph
> in the report contains too much data and the X-Axis labels just look like
> one big blob because all of the item labels are squeezed together too
> tightly.
> Has anyone found a way to say for example... If there are more than X
> number of items on the X Axis in the chart then to split the chart into 2
> charts. The second chart would appear directly beneath the 1st chart.
> This way the user would be able to telll what the data is they are looking
> at.
> This seems to be a common problem in all charting situations and the
> solution usually is just filtering on less data. I don't see why we have
> to tell the user to filter on less data and run multiple reports. It
> seems possible that en enterprise reporting application like RS should
> have this capability... or... the capability to code it in the report.
>
> Any ideas?
====
<?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>
<Table Name="table2">
<Height>0.75in</Height>
<Style />
<Header>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox2">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>3</ZIndex>
<rd:DefaultName>textbox2</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Product Name</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox4">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<rd:DefaultName>textbox4</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>0-200</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Header>
<DataSetName>Northwind</DataSetName>
<Top>0.125in</Top>
<TableGroups>
<TableGroup>
<Header>
<TableRows>
<TableRow>
<Height>0.5in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="ProductName_2">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<rd:DefaultName>ProductName_2</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!ProductName.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Chart Name="chart1">
<ThreeDProperties>
<Rotation>30</Rotation>
<Inclination>30</Inclination>
<Shading>Simple</Shading>
<WallThickness>50</WallThickness>
</ThreeDProperties>
<Style>
<BackgroundColor>White</BackgroundColor>
</Style>
<Legend>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
<Position>RightCenter</Position>
</Legend>
<Palette>Default</Palette>
<ChartData>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=Sum(Fields!UnitsInStock.Value)</Value>
</DataValue>
</DataValues>
<DataLabel />
<Marker />
</DataPoint>
</DataPoints>
</ChartSeries>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=Sum(Fields!UnitsOnOrder.Value)</Value>
</DataValue>
</DataValues>
<DataLabel />
<Marker />
</DataPoint>
</DataPoints>
</ChartSeries>
</ChartData>
<CategoryAxis>
<Axis>
<Title />
<MajorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<Min>0</Min>
</Axis>
</CategoryAxis>
<DataSetName>Northwind</DataSetName>
<PointWidth>0</PointWidth>
<Type>Bar</Type>
<Title />
<SeriesGroupings>
<SeriesGrouping>
<StaticSeries>
<StaticMember>
<Label>Units In Stock</Label>
</StaticMember>
<StaticMember>
<Label>Units On Order</Label>
</StaticMember>
</StaticSeries>
</SeriesGrouping>
</SeriesGroupings>
<Subtype>Stacked</Subtype>
<PlotArea>
<Style>
<BackgroundColor>LightGrey</BackgroundColor>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</PlotArea>
<ValueAxis>
<Axis>
<Title />
<MajorGridLines>
<ShowGridLines>true</ShowGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<Min>0</Min>
<Max>200</Max>
<Margin>true</Margin>
<Scalar>true</Scalar>
</Axis>
</ValueAxis>
</Chart>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Header>
<Grouping Name="table2_Group1">
<GroupExpressions>
<GroupExpression>=Fields!ProductName.Value</GroupExpression>
</GroupExpressions>
</Grouping>
</TableGroup>
</TableGroups>
<TableColumns>
<TableColumn>
<Width>1.33333in</Width>
</TableColumn>
<TableColumn>
<Width>3.5in</Width>
</TableColumn>
</TableColumns>
</Table>
</ReportItems>
<Style />
<Height>1.25in</Height>
</Body>
<TopMargin>1in</TopMargin>
<DataSources>
<DataSource Name="Northwind">
<rd:DataSourceID>99dae70f-00e4-4971-a2f6-486f3896814a</rd:DataSourceID>
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>data source=(local);initial
catalog=Northwind</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>
<Width>4.83333in</Width>
<DataSets>
<DataSet Name="Northwind">
<Fields>
<Field Name="ProductID">
<DataField>ProductID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="ProductName">
<DataField>ProductName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="SupplierID">
<DataField>SupplierID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="CategoryID">
<DataField>CategoryID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="QuantityPerUnit">
<DataField>QuantityPerUnit</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="UnitPrice">
<DataField>UnitPrice</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="UnitsInStock">
<DataField>UnitsInStock</DataField>
<rd:TypeName>System.Int16</rd:TypeName>
</Field>
<Field Name="UnitsOnOrder">
<DataField>UnitsOnOrder</DataField>
<rd:TypeName>System.Int16</rd:TypeName>
</Field>
<Field Name="ReorderLevel">
<DataField>ReorderLevel</DataField>
<rd:TypeName>System.Int16</rd:TypeName>
</Field>
<Field Name="Discontinued">
<DataField>Discontinued</DataField>
<rd:TypeName>System.Boolean</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>Northwind</DataSourceName>
<CommandText>select * from products</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
</DataSet>
</DataSets>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<PageHeight>100in</PageHeight>
<rd:DrawGrid>true</rd:DrawGrid>
<rd:ReportID>9ecf615a-64ce-4ec1-98bf-05333c406eb6</rd:ReportID>
<BottomMargin>1in</BottomMargin>
<Language>en-US</Language>
</Report>

Charting table detail and sum

I have a bar chart that displays the detail of a table with locations along the x-axis and number of employees on the y-axis. Is there any way to have the sum of all of the locations show as the final bar in the chart? (which would be the footer in the table)

Any help would be most appreciated,
Thanks

Sorry, "subtotals" are not directly supported in charts. But I'm not sure if you would really get the desired effect with a subtotal in charts. Since the individual employee groups share the same Y-axis as the total number of employees, you would most likely get many small bars and one long bar showing the total number of employees.
One alternative way is to add a second chart which just shows the total number of employees.

-- Robert|||Just wondering if total chart bar are still not supported ? I need that also...

Charting table detail and sum

I have a bar chart that displays the detail of a table with locations along the x-axis and number of employees on the y-axis. Is there any way to have the sum of all of the locations show as the final bar in the chart? (which would be the footer in the table)

Any help would be most appreciated,
Thanks

Sorry, "subtotals" are not directly supported in charts. But I'm not sure if you would really get the desired effect with a subtotal in charts. Since the individual employee groups share the same Y-axis as the total number of employees, you would most likely get many small bars and one long bar showing the total number of employees.
One alternative way is to add a second chart which just shows the total number of employees.

-- Robert|||Just wondering if total chart bar are still not supported ? I need that also...

Chart, how do I use format code for a label?

How do I refer to the actual value for the label inside my expression?
Say you have datetime data across the x-axis for the data. I get one row per
month in the dataset (every row is same date and time for each row/month). I
understand how I can format this, for instance "MMM" to get month name in
short format.
But if I want to do further or a bit more complex manipulation? In this
case, I want to show only first letter of the month. I fail to connect how
to put the actual data value inside my VB.NET expression (substring, left or
similar function in this case).
(I can retrieve the first letter of the month along with the data, as an
extra column, doing this in my stored procedure. If above is difficult, I'd
appreciate tips on how to refer to this column for the chart label. I.e., I
want to show some other column as the label, not the one used to derive the
actual value.)
TIA
Tibor Karaszi
SQL Server MVPExpressions for formatting labels are not directly supported in the current
release. You could do a bar chart and use an expression
(=Left(Format(Fields!OrderDate.Value, "MMM"), 1)) for the corresponding
category group. The sample report attached at the end of this post (which
runs against local Northwind database) demonstrates this.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OEwX0qaiEHA.2848@.TK2MSFTNGP10.phx.gbl...
> How do I refer to the actual value for the label inside my expression?
> Say you have datetime data across the x-axis for the data. I get one row
per
> month in the dataset (every row is same date and time for each row/month).
I
> understand how I can format this, for instance "MMM" to get month name in
> short format.
> But if I want to do further or a bit more complex manipulation? In this
> case, I want to show only first letter of the month. I fail to connect how
> to put the actual data value inside my VB.NET expression (substring, left
or
> similar function in this case).
> (I can retrieve the first letter of the month along with the data, as an
> extra column, doing this in my stored procedure. If above is difficult,
I'd
> appreciate tips on how to refer to this column for the chart label. I.e.,
I
> want to show some other column as the label, not the one used to derive
the
> actual value.)
> TIA
> Tibor Karaszi
> SQL Server MVP
>
+++++++++++++ Sample report +++++++++++++
<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefini
tion"
xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Chart Name="chart1">
<ThreeDProperties>
<Rotation>30</Rotation>
<Inclination>30</Inclination>
<Shading>Simple</Shading>
<WallThickness>50</WallThickness>
</ThreeDProperties>
<Style>
<BackgroundColor>White</BackgroundColor>
</Style>
<Legend>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
<Position>RightCenter</Position>
</Legend>
<Palette>Default</Palette>
<ChartData>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=Sum(Fields!Freight.Value)</Value>
</DataValue>
</DataValues>
<DataLabel />
<Marker />
</DataPoint>
</DataPoints>
</ChartSeries>
</ChartData>
<CategoryAxis>
<Axis>
<Title />
<Style>
<FontSize>8pt</FontSize>
</Style>
<MajorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<Min>0</Min>
<Visible>true</Visible>
</Axis>
</CategoryAxis>
<DataSetName>Northwind</DataSetName>
<PointWidth>0</PointWidth>
<Type>Bar</Type>
<Title />
<Width>5.25in</Width>
<CategoryGroupings>
<CategoryGrouping>
<DynamicCategories>
<Grouping Name="chart1_CategoryGroup1">
<GroupExpressions>
<GroupExpression>=Fields!OrderDate.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Label>=Left(Format(Fields!OrderDate.Value, "MMM"), 1) & "
[" & Format(Fields!OrderDate.Value, "MMM yyyy") & "]"</Label>
</DynamicCategories>
</CategoryGrouping>
</CategoryGroupings>
<Subtype>Plain</Subtype>
<PlotArea>
<Style>
<BackgroundColor>LightGrey</BackgroundColor>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</PlotArea>
<ValueAxis>
<Axis>
<Title />
<Style>
<Format>c</Format>
<FontSize>8pt</FontSize>
</Style>
<MajorGridLines>
<ShowGridLines>true</ShowGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<Min>0</Min>
<Margin>true</Margin>
<Visible>true</Visible>
<Scalar>true</Scalar>
</Axis>
</ValueAxis>
</Chart>
</ReportItems>
<Style />
<Height>3in</Height>
</Body>
<TopMargin>1in</TopMargin>
<DataSources>
<DataSource Name="Northwind">
<rd:DataSourceID>14b06457-afff-49a5-9624-2ecc74ef5643</rd:DataSourceID>
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>initial catalog=Northwind</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>
<Width>6.25in</Width>
<DataSets>
<DataSet Name="Northwind">
<Fields>
<Field Name="OrderDate">
<DataField>OrderDate</DataField>
<rd:TypeName>System.DateTime</rd:TypeName>
</Field>
<Field Name="Freight">
<DataField>Freight</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>Northwind</DataSourceName>
<CommandText>SELECT TOP 10 OrderDate, Freight
FROM Orders
ORDER BY ShipCity</CommandText>
</Query>
</DataSet>
</DataSets>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<rd:ReportID>b8405333-c29c-4c57-8ba3-7915ae7bf5eb</rd:ReportID>
<BottomMargin>1in</BottomMargin>
<Language>en-US</Language>
</Report>

chart x-axis y-axis

I'm trying to convert an old chart to Reporting Services.
We have used the same dataset for years, it is very very simple. But it seems to me that Reporting Services can't deal with this simple dataset.

My question is: How can I get create a line chart using this dataset.

The data set consists of 1 row with 96 columns (a day divided into 96 sets of 15 minutes). Each column records how many events occurs within the 15 minutes. Along the x axis I would like to display a vertical line every 4 hours. The y axis should be numbered 0 to the highest value in the results.

I could not make this dataset any more simple than it is. But Reporting Services just chokes on this.

Here is a sample of the dataset :
1 2 0 4 5 6 7 8 9 10... 96It looks as thought what I may need is to reset the dataset to look like this:
time events
00-14 1
15-29 2
30-44 0
...

The only way I could do that with the existing tables would be 96 unions.

96 Unions!
Microsoft I must say that I am not so impressed with reporting services. Dragging fields to a myesterous chart "category" or "series" was dumb to begin with.

Chart X-axis & Y-axis Title

Does RS allow to use expression to generate titles for X- and Y-axis, either
through a field obtained from the database or a Parameter ?
Right now, even after SP1, I do not see a button that leads to <Expression>
dialog for X and Y-axis title, similar to say a <textbox> control.
Thanks.Although there is no expression builder button there, you can type any
expression you want for axes titles.
--
Brian Welcker
Group Program Manager
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kam" <Kam@.discussions.microsoft.com> wrote in message
news:9543D0CD-C766-4ED5-BEDA-CD43728F2728@.microsoft.com...
> Does RS allow to use expression to generate titles for X- and Y-axis,
> either
> through a field obtained from the database or a Parameter ?
> Right now, even after SP1, I do not see a button that leads to
> <Expression>
> dialog for X and Y-axis title, similar to say a <textbox> control.
> Thanks.

Chart x-axis

I am trying to create a chart using end_date (parameter) as the x-axis. I
have set up the category group expression as "=Month(Fields!End_Date.Value)"
and this is used for my x-axis. When the report is viewed, it shows January -
September, November, December, then October. The end_date is setup as
datetime datatype. The value and the labels are correct, just in the wrong
order. How can I get this x-axis in the correct order?On Aug 14, 9:08 pm, j_rad <j_...@.discussions.microsoft.com> wrote:
> I am trying to create a chart using end_date (parameter) as the x-axis. I
> have set up the category group expression as "=Month(Fields!End_Date.Value)"
> and this is used for my x-axis. When the report is viewed, it shows January -
> September, November, December, then October. The end_date is setup as
> datetime datatype. The value and the labels are correct, just in the wrong
> order. How can I get this x-axis in the correct order?
Hi,
Try to put the sorting expression of the group =Month(Fields!
End_Date.Value)
with ascending order.
V.|||That worked. Thanks for your help.
"Vinnie" wrote:
> On Aug 14, 9:08 pm, j_rad <j_...@.discussions.microsoft.com> wrote:
> > I am trying to create a chart using end_date (parameter) as the x-axis. I
> > have set up the category group expression as "=Month(Fields!End_Date.Value)"
> > and this is used for my x-axis. When the report is viewed, it shows January -
> > September, November, December, then October. The end_date is setup as
> > datetime datatype. The value and the labels are correct, just in the wrong
> > order. How can I get this x-axis in the correct order?
> Hi,
> Try to put the sorting expression of the group =Month(Fields!
> End_Date.Value)
> with ascending order.
> V.
>

Chart warning when "time-scaled values" is enabled.

I have a line chart with an x-axis of dates. When I enable "time-scaled
values" on the x-axis of the chart properties, I get this warning and the
chart does not graph the data properly.
"The sorting applied to the category grouping of the chart â'chart2â' is
different from the grouping expression."
If I disable "time-scaled values" the chart graphs the data properly, but
then I see way too many date labels on the x-axis that makes it unreadable.
Does anyone know how to resolve the above warning and still get the same
readability on the x-axis?You can ignore this particular warning. It should not be shown when
time-scaled values is selected.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jeff" <Jeff@.discussions.microsoft.com> wrote in message
news:8344F12E-2AB5-4341-8FF3-46A553E2B242@.microsoft.com...
> I have a line chart with an x-axis of dates. When I enable "time-scaled
> values" on the x-axis of the chart properties, I get this warning and the
> chart does not graph the data properly.
> "The sorting applied to the category grouping of the chart 'chart2' is
> different from the grouping expression."
> If I disable "time-scaled values" the chart graphs the data properly,
> but
> then I see way too many date labels on the x-axis that makes it
> unreadable.
> Does anyone know how to resolve the above warning and still get the same
> readability on the x-axis?
>|||I noticed the warning on some of the Microsoft created reports that are
similar to mine, but the chart in my report does not graph the data
correctly. Instead of a slow growth curve, I get what looks like a toddler
scribbled on my graph. If I disable "time-scaled values" then the data
graphs properly, but then the x-axis is unreadable due to the numerous
samples of data.
"Robert Bruckner [MSFT]" wrote:
> You can ignore this particular warning. It should not be shown when
> time-scaled values is selected.
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Jeff" <Jeff@.discussions.microsoft.com> wrote in message
> news:8344F12E-2AB5-4341-8FF3-46A553E2B242@.microsoft.com...
> > I have a line chart with an x-axis of dates. When I enable "time-scaled
> > values" on the x-axis of the chart properties, I get this warning and the
> > chart does not graph the data properly.
> > "The sorting applied to the category grouping of the chart 'chart2' is
> > different from the grouping expression."
> > If I disable "time-scaled values" the chart graphs the data properly,
> > but
> > then I see way too many date labels on the x-axis that makes it
> > unreadable.
> > Does anyone know how to resolve the above warning and still get the same
> > readability on the x-axis?
> >
>
>|||If time-scaled is turned OFF, you have to add an explicit sorting expression
on the chart category groups. The sorting has to be identical to the
grouping expression. Then the data will be sorted and you will get a slow
growth curve.
You can solve the issue with too many labels on the x-axis by setting the
x-axis MINOR interval value to e.g. 5 (i.e. one label per 5 categories /
data samples).
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jeff" <Jeff@.discussions.microsoft.com> wrote in message
news:7BED67CB-B8E0-4D08-8F80-CB4DD2463EF7@.microsoft.com...
> I noticed the warning on some of the Microsoft created reports that are
> similar to mine, but the chart in my report does not graph the data
> correctly. Instead of a slow growth curve, I get what looks like a
> toddler
> scribbled on my graph. If I disable "time-scaled values" then the data
> graphs properly, but then the x-axis is unreadable due to the numerous
> samples of data.
> "Robert Bruckner [MSFT]" wrote:
>> You can ignore this particular warning. It should not be shown when
>> time-scaled values is selected.
>> -- Robert
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Jeff" <Jeff@.discussions.microsoft.com> wrote in message
>> news:8344F12E-2AB5-4341-8FF3-46A553E2B242@.microsoft.com...
>> > I have a line chart with an x-axis of dates. When I enable
>> > "time-scaled
>> > values" on the x-axis of the chart properties, I get this warning and
>> > the
>> > chart does not graph the data properly.
>> > "The sorting applied to the category grouping of the chart 'chart2'
>> > is
>> > different from the grouping expression."
>> > If I disable "time-scaled values" the chart graphs the data properly,
>> > but
>> > then I see way too many date labels on the x-axis that makes it
>> > unreadable.
>> > Does anyone know how to resolve the above warning and still get the
>> > same
>> > readability on the x-axis?
>> >
>>

Friday, February 24, 2012

Chart Question: Number of Bars on X-axis

Hi Guys,
Is there any way, we can set the number of Bars on X-axis per Page (in a
Column Chart) in Report Designer?
All I want to do is set no of Bars per page so that a new page is created if
the number of bars on the X-axis exceeds the given value..
Any help is appreciated..
Regards
Raj ChidipudiThis is not natively supported in RS2000.
Depending on your actual data, you may be able to use filters on the first
chart and dynamically show/hide additional charts (with page breaks) if the
number of bars is too high for the first chart.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Raj Chidipudi" <someone@.email.com> wrote in message
news:Ok9QsdbmEHA.596@.TK2MSFTNGP11.phx.gbl...
> Hi Guys,
> Is there any way, we can set the number of Bars on X-axis per Page (in a
> Column Chart) in Report Designer?
> All I want to do is set no of Bars per page so that a new page is created
if
> the number of bars on the X-axis exceeds the given value..
> Any help is appreciated..
> Regards
> Raj Chidipudi
>

Chart Problem: Multiple values to y-axis for the the same x-axis value

I have a simple-column chart and in the x-axis I put the date values and in the y-axis the sale price values.

The chart works perfectly in the case when there is only one sale price for the same date. But, when the price changes during the same day, then there is problem. In the following example

x y

1/1/2007 6.25

2/1/2007 7

2/1/2007 4

3/1/2007 8

the chart will have three columns and in the date 2/1/2007 will display the min or max of the two values. What I need is to represent all the values i.e. the chart must have four columns , as much as the rows of the dataset

Is it possible?

It sounds like your category grouping is based on the DateTime value. Therefore, data values with the same timestamp are grouped together.

You will need to change the category grouping similar to the "StepFunctionChart" sample discussed in the following whitepaper (near the end): http://msdn2.microsoft.com/en-us/library/aa964128.aspx - search for "StepFunctionChart".

Basically, you need a category grouping expression that will make sure every data row is its own group, e.g. by concatenation:

=Fields!Y.Value & "|" & Fields!TimeStamp.Value

-- Robert

Chart problem "X-axis" and "Chart properties/Data/Values"

I have two problems with the barchart I made. I made the barchart with data that
I could not read immediately from the Database. The requiered data has to be
calculated by reading data from the database and using a function which I
placed in the "Code" window.
The bar chart I made calculates how many employees are working during a period.
One day is displayed as 24 bars, one bar for every hour.
If e.g. an employee works from 7:30 till 16:30, the barchart shows from the hour
bar number 7 till number 16 one employee working. On the (vertical) Y-axis you can
see the number of employees and the (horizontal) x-axis should display the hours
starting by 0 till 23.
The first problem is that the x-axis can not display anything. This has to do with
the fact that I am not using category groups. I this situation it seems to me that I can not use the category groups because it has no use at all . I made for every hour bar a value in the "Chart properties" window under the "Data" tab. So I made 24 values which I labeled from 0 till 23. The point labels are also from 0 till 23 so I can diplay that on the chart. Otherwise the values of the bars can not be read because the x-axis does not show them.
I used the following expression for the bar 7:
_____________________________________
=Sum(iif(code.WorkingTime(7,Fields!TimeStart.Value, Fields!TimeFinish.Value) ,1,0))
_____________________________________
For the other bars the number 7 is being adjusted to the according hour.
The TimeStart and TimeFinish are "Dates" in the database where I can extract
the necessary information.
I used the following function in the "Code" window to extraxt the working time of an employee.
___________________________________________
Public Function WorkingTime(ByVal valHour As Integer, ByVal valTimeStart As Date, ByVal valTimeFinish As Date) As Boolean
Dim StartHour, EndHour, EndMinutes
StartHour = DatePart(DateInterval.Hour, valTimeStart)
EndHour = DatePart(DateInterval.Hour, valTimeFinish)
EndMinutes = DatePart(DateInterval.Minute, valTimeFinish)
If (StartHour < (valhour + 1)) And _
((EndHour > valhour) or _
(Endhour = valHour And EndMinutes <> 0)) Then
Return True
End If
End Function
_______________________________________________
Everything is working but I am not satisfied with two issues and I like to know if
there are solutions for it. My quesions are:
1. How can I display on the horizontal x-axis the hours from 0 to 23 in the specific
situation I explained or in a way that the same goal is being achieved?
2. How can i make the code easier to mantain? Now I have to fill in for
every hour the expression, that is 24 times. Is there a simpeler way?
I ask this because I probably have to expand this chart, the client
like to see the information on a 15 minutes basis. This means I will
have to fill in (24 X 4 =) 96 times the same expression.
Thanks in advance for any help.
PacoThese are the alternatives you have:
(1) In order to have the X-axis show values from 0 to 23 you would need use
"static category groups". This is supported in the RDL and on the report
server, however currently not in the report design tool. Therefore you would
need to manually convert the 24 "values" (which are actually static series
groups) into static category groups.
(2) Write a stored procedure that converts the current data storage
structure from 1 row containing TimeStart, TimeFinish into one row per e.g.
work hour or work quarter. Then you could simply create a chart based on the
stored procedure dataset with a category grouping =Fields!WorkHour, no
series grouping, and a value of =Count(Fields!EmployeeID.Value). For the
X-axis you would turn on "Numeric or time-scale values" and set a minimum of
0 and a maximum of 24.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Paco" <Paco@.discussions.microsoft.com> wrote in message
news:90C876F0-7438-4675-9A27-66931E6D0C02@.microsoft.com...
> I have two problems with the barchart I made. I made the barchart with
data that
> I could not read immediately from the Database. The requiered data has to
be
> calculated by reading data from the database and using a function which I
> placed in the "Code" window.
> The bar chart I made calculates how many employees are working during a
period.
> One day is displayed as 24 bars, one bar for every hour.
> If e.g. an employee works from 7:30 till 16:30, the barchart shows from
the hour
> bar number 7 till number 16 one employee working. On the (vertical) Y-axis
you can
> see the number of employees and the (horizontal) x-axis should display the
hours
> starting by 0 till 23.
> The first problem is that the x-axis can not display anything. This has to
do with
> the fact that I am not using category groups. I this situation it seems to
me that I can not use the category groups because it has no use at all . I
made for every hour bar a value in the "Chart properties" window under the
"Data" tab. So I made 24 values which I labeled from 0 till 23. The point
labels are also from 0 till 23 so I can diplay that on the chart. Otherwise
the values of the bars can not be read because the x-axis does not show
them.
> I used the following expression for the bar 7:
> _____________________________________
> =Sum(iif(code.WorkingTime(7,Fields!TimeStart.Value,
Fields!TimeFinish.Value) ,1,0))
> _____________________________________
> For the other bars the number 7 is being adjusted to the according hour.
> The TimeStart and TimeFinish are "Dates" in the database where I can
extract
> the necessary information.
> I used the following function in the "Code" window to extraxt the working
time of an employee.
> ___________________________________________
> Public Function WorkingTime(ByVal valHour As Integer, ByVal valTimeStart
As Date, ByVal valTimeFinish As Date) As Boolean
> Dim StartHour, EndHour, EndMinutes
> StartHour = DatePart(DateInterval.Hour, valTimeStart)
> EndHour = DatePart(DateInterval.Hour, valTimeFinish)
> EndMinutes = DatePart(DateInterval.Minute, valTimeFinish)
> If (StartHour < (valhour + 1)) And _
> ((EndHour > valhour) or _
> (Endhour = valHour And EndMinutes <> 0)) Then
> Return True
> End If
> End Function
> _______________________________________________
> Everything is working but I am not satisfied with two issues and I like to
know if
> there are solutions for it. My quesions are:
> 1. How can I display on the horizontal x-axis the hours from 0 to 23 in
the specific
> situation I explained or in a way that the same goal is being achieved?
> 2. How can i make the code easier to mantain? Now I have to fill in for
> every hour the expression, that is 24 times. Is there a simpeler way?
> I ask this because I probably have to expand this chart, the client
> like to see the information on a 15 minutes basis. This means I will
> have to fill in (24 X 4 =) 96 times the same expression.
> Thanks in advance for any help.
> Paco|||I tried alternative (1). I did not succeed after making the convert. I get the following 2 error messages:
C:\.....\filename.rdl The chart â'chart1â' contains a different number of ChartSeries elements than the number of StaticSeries elements. If the chart contains no StaticSeries, it must contain one ChartSeries.
C:\.....\filename.rdl The chart â'chart1â' contains a different number of DataPoints per ChartSeries element than the number of StaticCategory elements. If the chart contains no StaticCategory, it must contain one DataPoint per ChartSeries.
This is the change I made in the rdl:
<CategoryGroupings>
<CategoryGrouping>
<StaticCategories>
<StaticMember>
<Label>0</Label>
</StaticMember>
e.t.c. till 23
<StaticMember>
<Label>23</Label>
</StaticMember>
</StaticCategories>
</CategoryGrouping>
</CategoryGroupings>
I think I also have to change the following code but I do not know what the changes have to be:
<ChartData>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=Sum(iif(code.Inzet(0,Fields!TijdVan.Value, Fields! TijdTot.Value) ,1,0))</Value>
</DataValue>
</DataValues>
<DataLabel>
<Value>0</Value>
<Visible>true</Visible>
</DataLabel>
<Style>
<BackgroundColor>Green</BackgroundColor>
</Style>
<Marker>
<Size>6pt</Size>
</Marker>
</DataPoint>
</DataPoints>
</ChartSeries>
till 23
</ChartData>
At this moment the code is not working with the new changes I made. Is it correct that I have to change the previous code? If so, how? Is there something else a matter why it is not working?
Paco
"Robert Bruckner [MSFT]" wrote:
> These are the alternatives you have:
> (1) In order to have the X-axis show values from 0 to 23 you would need use
> "static category groups". This is supported in the RDL and on the report
> server, however currently not in the report design tool. Therefore you would
> need to manually convert the 24 "values" (which are actually static series
> groups) into static category groups.
> (2) Write a stored procedure that converts the current data storage
> structure from 1 row containing TimeStart, TimeFinish into one row per e.g.
> work hour or work quarter. Then you could simply create a chart based on the
> stored procedure dataset with a category grouping =Fields!WorkHour, no
> series grouping, and a value of =Count(Fields!EmployeeID.Value). For the
> X-axis you would turn on "Numeric or time-scale values" and set a minimum of
> 0 and a maximum of 24.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Paco" <Paco@.discussions.microsoft.com> wrote in message
> news:90C876F0-7438-4675-9A27-66931E6D0C02@.microsoft.com...
> > I have two problems with the barchart I made. I made the barchart with
> data that
> > I could not read immediately from the Database. The requiered data has to
> be
> > calculated by reading data from the database and using a function which I
> > placed in the "Code" window.
> > The bar chart I made calculates how many employees are working during a
> period.
> > One day is displayed as 24 bars, one bar for every hour.
> >
> > If e.g. an employee works from 7:30 till 16:30, the barchart shows from
> the hour
> > bar number 7 till number 16 one employee working. On the (vertical) Y-axis
> you can
> > see the number of employees and the (horizontal) x-axis should display the
> hours
> > starting by 0 till 23.
> >
> > The first problem is that the x-axis can not display anything. This has to
> do with
> > the fact that I am not using category groups. I this situation it seems to
> me that I can not use the category groups because it has no use at all . I
> made for every hour bar a value in the "Chart properties" window under the
> "Data" tab. So I made 24 values which I labeled from 0 till 23. The point
> labels are also from 0 till 23 so I can diplay that on the chart. Otherwise
> the values of the bars can not be read because the x-axis does not show
> them.
> >
> > I used the following expression for the bar 7:
> > _____________________________________
> > =Sum(iif(code.WorkingTime(7,Fields!TimeStart.Value,
> Fields!TimeFinish.Value) ,1,0))
> > _____________________________________
> >
> > For the other bars the number 7 is being adjusted to the according hour.
> > The TimeStart and TimeFinish are "Dates" in the database where I can
> extract
> > the necessary information.
> >
> > I used the following function in the "Code" window to extraxt the working
> time of an employee.
> > ___________________________________________
> > Public Function WorkingTime(ByVal valHour As Integer, ByVal valTimeStart
> As Date, ByVal valTimeFinish As Date) As Boolean
> > Dim StartHour, EndHour, EndMinutes
> > StartHour = DatePart(DateInterval.Hour, valTimeStart)
> > EndHour = DatePart(DateInterval.Hour, valTimeFinish)
> > EndMinutes = DatePart(DateInterval.Minute, valTimeFinish)
> >
> > If (StartHour < (valhour + 1)) And _
> > ((EndHour > valhour) or _
> > (Endhour = valHour And EndMinutes <> 0)) Then
> > Return True
> > End If
> > End Function
> > _______________________________________________
> >
> > Everything is working but I am not satisfied with two issues and I like to
> know if
> > there are solutions for it. My quesions are:
> > 1. How can I display on the horizontal x-axis the hours from 0 to 23 in
> the specific
> > situation I explained or in a way that the same goal is being achieved?
> > 2. How can i make the code easier to mantain? Now I have to fill in for
> > every hour the expression, that is 24 times. Is there a simpeler way?
> > I ask this because I probably have to expand this chart, the client
> > like to see the information on a 15 minutes basis. This means I will
> > have to fill in (24 X 4 =) 96 times the same expression.
> >
> > Thanks in advance for any help.
> >
> > Paco
>
>|||The CategoryGroupings section of the RDL file seems correct.
However, you also need to change the structure of the ChartData section.
Rather than 1 Datapoint per ChartSeries element and 24 ChartSeries elements
in the entire file (i.e. 24 static series), you need to have just 1
ChartSeries element which contains 1 DataPoints element with 24 DataPoint
elements (i.e. 24 static categories).
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Paco" <Paco@.discussions.microsoft.com> wrote in message
news:F481ACB9-1C7F-49E1-873E-46F35AE8FC94@.microsoft.com...
> I tried alternative (1). I did not succeed after making the convert. I get
the following 2 error messages:
> C:\.....\filename.rdl The chart 'chart1' contains a different number of
ChartSeries elements than the number of StaticSeries elements. If the chart
contains no StaticSeries, it must contain one ChartSeries.
> C:\.....\filename.rdl The chart 'chart1' contains a different number of
DataPoints per ChartSeries element than the number of StaticCategory
elements. If the chart contains no StaticCategory, it must contain one
DataPoint per ChartSeries.
> This is the change I made in the rdl:
> <CategoryGroupings>
> <CategoryGrouping>
> <StaticCategories>
> <StaticMember>
> <Label>0</Label>
> </StaticMember>
> e.t.c. till 23
> <StaticMember>
> <Label>23</Label>
> </StaticMember>
> </StaticCategories>
> </CategoryGrouping>
> </CategoryGroupings>
> I think I also have to change the following code but I do not know what
the changes have to be:
> <ChartData>
> <ChartSeries>
> <DataPoints>
> <DataPoint>
> <DataValues>
> <DataValue>
> <Value>=Sum(iif(code.Inzet(0,Fields!TijdVan.Value,
Fields! TijdTot.Value) ,1,0))</Value>
> </DataValue>
> </DataValues>
> <DataLabel>
> <Value>0</Value>
> <Visible>true</Visible>
> </DataLabel>
> <Style>
> <BackgroundColor>Green</BackgroundColor>
> </Style>
> <Marker>
> <Size>6pt</Size>
> </Marker>
> </DataPoint>
> </DataPoints>
> </ChartSeries>
> till 23
> </ChartData>
> At this moment the code is not working with the new changes I made. Is it
correct that I have to change the previous code? If so, how? Is there
something else a matter why it is not working?
> Paco
>
> "Robert Bruckner [MSFT]" wrote:
> > These are the alternatives you have:
> >
> > (1) In order to have the X-axis show values from 0 to 23 you would need
use
> > "static category groups". This is supported in the RDL and on the report
> > server, however currently not in the report design tool. Therefore you
would
> > need to manually convert the 24 "values" (which are actually static
series
> > groups) into static category groups.
> >
> > (2) Write a stored procedure that converts the current data storage
> > structure from 1 row containing TimeStart, TimeFinish into one row per
e.g.
> > work hour or work quarter. Then you could simply create a chart based on
the
> > stored procedure dataset with a category grouping =Fields!WorkHour, no
> > series grouping, and a value of =Count(Fields!EmployeeID.Value). For the
> > X-axis you would turn on "Numeric or time-scale values" and set a
minimum of
> > 0 and a maximum of 24.
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> >
> >
> > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > news:90C876F0-7438-4675-9A27-66931E6D0C02@.microsoft.com...
> > > I have two problems with the barchart I made. I made the barchart with
> > data that
> > > I could not read immediately from the Database. The requiered data has
to
> > be
> > > calculated by reading data from the database and using a function
which I
> > > placed in the "Code" window.
> > > The bar chart I made calculates how many employees are working during
a
> > period.
> > > One day is displayed as 24 bars, one bar for every hour.
> > >
> > > If e.g. an employee works from 7:30 till 16:30, the barchart shows
from
> > the hour
> > > bar number 7 till number 16 one employee working. On the (vertical)
Y-axis
> > you can
> > > see the number of employees and the (horizontal) x-axis should display
the
> > hours
> > > starting by 0 till 23.
> > >
> > > The first problem is that the x-axis can not display anything. This
has to
> > do with
> > > the fact that I am not using category groups. I this situation it
seems to
> > me that I can not use the category groups because it has no use at all .
I
> > made for every hour bar a value in the "Chart properties" window under
the
> > "Data" tab. So I made 24 values which I labeled from 0 till 23. The
point
> > labels are also from 0 till 23 so I can diplay that on the chart.
Otherwise
> > the values of the bars can not be read because the x-axis does not show
> > them.
> > >
> > > I used the following expression for the bar 7:
> > > _____________________________________
> > > =Sum(iif(code.WorkingTime(7,Fields!TimeStart.Value,
> > Fields!TimeFinish.Value) ,1,0))
> > > _____________________________________
> > >
> > > For the other bars the number 7 is being adjusted to the according
hour.
> > > The TimeStart and TimeFinish are "Dates" in the database where I can
> > extract
> > > the necessary information.
> > >
> > > I used the following function in the "Code" window to extraxt the
working
> > time of an employee.
> > > ___________________________________________
> > > Public Function WorkingTime(ByVal valHour As Integer, ByVal
valTimeStart
> > As Date, ByVal valTimeFinish As Date) As Boolean
> > > Dim StartHour, EndHour, EndMinutes
> > > StartHour = DatePart(DateInterval.Hour, valTimeStart)
> > > EndHour = DatePart(DateInterval.Hour, valTimeFinish)
> > > EndMinutes = DatePart(DateInterval.Minute, valTimeFinish)
> > >
> > > If (StartHour < (valhour + 1)) And _
> > > ((EndHour > valhour) or _
> > > (Endhour = valHour And EndMinutes <> 0)) Then
> > > Return True
> > > End If
> > > End Function
> > > _______________________________________________
> > >
> > > Everything is working but I am not satisfied with two issues and I
like to
> > know if
> > > there are solutions for it. My quesions are:
> > > 1. How can I display on the horizontal x-axis the hours from 0 to 23
in
> > the specific
> > > situation I explained or in a way that the same goal is being
achieved?
> > > 2. How can i make the code easier to mantain? Now I have to fill in
for
> > > every hour the expression, that is 24 times. Is there a simpeler way?
> > > I ask this because I probably have to expand this chart, the client
> > > like to see the information on a 15 minutes basis. This means I will
> > > have to fill in (24 X 4 =) 96 times the same expression.
> > >
> > > Thanks in advance for any help.
> > >
> > > Paco
> >
> >
> >|||I changed the code as you described and it is working fine. However, the expression has to be in every dataopint in the RDL file. I tried to change and test what happens if I change the code going to "Chart properties/data/values/".
There is only the first expression and if I change it the whole chart does not work anymore. It seems to me I can not do anything in that section because the chart will not work. If I could make some changes I would trie to use a code with a loop to get the 24 "hour bars".
How can I use the expression one time? Is it e.g. possible to make a function, in the code window or an assembly, with a loop so the code is written 24 times to the RDL file by calling that function in the RDL file? This way I only have to make changes in the function. Or is there an other possiblity?
"Robert Bruckner [MSFT]" wrote:
> The CategoryGroupings section of the RDL file seems correct.
> However, you also need to change the structure of the ChartData section.
> Rather than 1 Datapoint per ChartSeries element and 24 ChartSeries elements
> in the entire file (i.e. 24 static series), you need to have just 1
> ChartSeries element which contains 1 DataPoints element with 24 DataPoint
> elements (i.e. 24 static categories).
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Paco" <Paco@.discussions.microsoft.com> wrote in message
> news:F481ACB9-1C7F-49E1-873E-46F35AE8FC94@.microsoft.com...
> > I tried alternative (1). I did not succeed after making the convert. I get
> the following 2 error messages:
> >
> > C:\.....\filename.rdl The chart 'chart1' contains a different number of
> ChartSeries elements than the number of StaticSeries elements. If the chart
> contains no StaticSeries, it must contain one ChartSeries.
> >
> > C:\.....\filename.rdl The chart 'chart1' contains a different number of
> DataPoints per ChartSeries element than the number of StaticCategory
> elements. If the chart contains no StaticCategory, it must contain one
> DataPoint per ChartSeries.
> >
> > This is the change I made in the rdl:
> > <CategoryGroupings>
> > <CategoryGrouping>
> > <StaticCategories>
> > <StaticMember>
> > <Label>0</Label>
> > </StaticMember>
> >
> > e.t.c. till 23
> >
> > <StaticMember>
> > <Label>23</Label>
> > </StaticMember>
> > </StaticCategories>
> > </CategoryGrouping>
> > </CategoryGroupings>
> >
> > I think I also have to change the following code but I do not know what
> the changes have to be:
> >
> > <ChartData>
> > <ChartSeries>
> > <DataPoints>
> > <DataPoint>
> > <DataValues>
> > <DataValue>
> > <Value>=Sum(iif(code.Inzet(0,Fields!TijdVan.Value,
> Fields! TijdTot.Value) ,1,0))</Value>
> > </DataValue>
> > </DataValues>
> > <DataLabel>
> > <Value>0</Value>
> > <Visible>true</Visible>
> > </DataLabel>
> > <Style>
> > <BackgroundColor>Green</BackgroundColor>
> > </Style>
> > <Marker>
> > <Size>6pt</Size>
> > </Marker>
> > </DataPoint>
> > </DataPoints>
> > </ChartSeries>
> >
> > till 23
> >
> > </ChartData>
> >
> > At this moment the code is not working with the new changes I made. Is it
> correct that I have to change the previous code? If so, how? Is there
> something else a matter why it is not working?
> >
> > Paco
> >
> >
> >
> > "Robert Bruckner [MSFT]" wrote:
> >
> > > These are the alternatives you have:
> > >
> > > (1) In order to have the X-axis show values from 0 to 23 you would need
> use
> > > "static category groups". This is supported in the RDL and on the report
> > > server, however currently not in the report design tool. Therefore you
> would
> > > need to manually convert the 24 "values" (which are actually static
> series
> > > groups) into static category groups.
> > >
> > > (2) Write a stored procedure that converts the current data storage
> > > structure from 1 row containing TimeStart, TimeFinish into one row per
> e.g.
> > > work hour or work quarter. Then you could simply create a chart based on
> the
> > > stored procedure dataset with a category grouping =Fields!WorkHour, no
> > > series grouping, and a value of =Count(Fields!EmployeeID.Value). For the
> > > X-axis you would turn on "Numeric or time-scale values" and set a
> minimum of
> > > 0 and a maximum of 24.
> > >
> > > --
> > > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > >
> > >
> > >
> > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > news:90C876F0-7438-4675-9A27-66931E6D0C02@.microsoft.com...
> > > > I have two problems with the barchart I made. I made the barchart with
> > > data that
> > > > I could not read immediately from the Database. The requiered data has
> to
> > > be
> > > > calculated by reading data from the database and using a function
> which I
> > > > placed in the "Code" window.
> > > > The bar chart I made calculates how many employees are working during
> a
> > > period.
> > > > One day is displayed as 24 bars, one bar for every hour.
> > > >
> > > > If e.g. an employee works from 7:30 till 16:30, the barchart shows
> from
> > > the hour
> > > > bar number 7 till number 16 one employee working. On the (vertical)
> Y-axis
> > > you can
> > > > see the number of employees and the (horizontal) x-axis should display
> the
> > > hours
> > > > starting by 0 till 23.
> > > >
> > > > The first problem is that the x-axis can not display anything. This
> has to
> > > do with
> > > > the fact that I am not using category groups. I this situation it
> seems to
> > > me that I can not use the category groups because it has no use at all .
> I
> > > made for every hour bar a value in the "Chart properties" window under
> the
> > > "Data" tab. So I made 24 values which I labeled from 0 till 23. The
> point
> > > labels are also from 0 till 23 so I can diplay that on the chart.
> Otherwise
> > > the values of the bars can not be read because the x-axis does not show
> > > them.
> > > >
> > > > I used the following expression for the bar 7:
> > > > _____________________________________
> > > > =Sum(iif(code.WorkingTime(7,Fields!TimeStart.Value,
> > > Fields!TimeFinish.Value) ,1,0))
> > > > _____________________________________
> > > >
> > > > For the other bars the number 7 is being adjusted to the according
> hour.
> > > > The TimeStart and TimeFinish are "Dates" in the database where I can
> > > extract
> > > > the necessary information.
> > > >
> > > > I used the following function in the "Code" window to extraxt the
> working
> > > time of an employee.
> > > > ___________________________________________
> > > > Public Function WorkingTime(ByVal valHour As Integer, ByVal
> valTimeStart
> > > As Date, ByVal valTimeFinish As Date) As Boolean
> > > > Dim StartHour, EndHour, EndMinutes
> > > > StartHour = DatePart(DateInterval.Hour, valTimeStart)
> > > > EndHour = DatePart(DateInterval.Hour, valTimeFinish)
> > > > EndMinutes = DatePart(DateInterval.Minute, valTimeFinish)
> > > >
> > > > If (StartHour < (valhour + 1)) And _
> > > > ((EndHour > valhour) or _
> > > > (Endhour = valHour And EndMinutes <> 0)) Then
> > > > Return True
> > > > End If
> > > > End Function
> > > > _______________________________________________
> > > >
> > > > Everything is working but I am not satisfied with two issues and I
> like to
> > > know if
> > > > there are solutions for it. My quesions are:
> > > > 1. How can I display on the horizontal x-axis the hours from 0 to 23
> in
> > > the specific
> > > > situation I explained or in a way that the same goal is being
> achieved?
> > > > 2. How can i make the code easier to mantain? Now I have to fill in
> for
> > > > every hour the expression, that is 24 times. Is there a simpeler way?
> > > > I ask this because I probably have to expand this chart, the client
> > > > like to see the information on a 15 minutes basis. This means I will
> > > > have to fill in (24 X 4 =) 96 times the same expression.
> > > >
> > > > Thanks in advance for any help.
> > > >
> > > > Paco
> > >
> > >
> > >
>
>|||If you use "static categories", then as I mentioned in my first posting, you
can no longer modify the report in the report designer because it does _not_
support it - only the server supports it right now. If you load it in report
designer and modify any property it will destroy the original changes. Just
upload the modified RDL on the server and it will work.
Also, as indicated in the other post, you will need 24 static categories and
therefore have 24 datapoints (1 datapoint per static category). The only
thing you gained by approach (1) is to have control over the X-axis.
If you just want to have 1 datapoint expression, then you have to use
approach (2). As described earlier, you will need to write a stored
procedure and change the structure of the dataset. Then you will then just
have 1 datapoint defined with =Count(Fields!EmployeeID.Value) and 1 dynamic
category grouping =Fields!WorkHour.Value, which will automatically group the
data per workhour.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Paco" <Paco@.discussions.microsoft.com> wrote in message
news:1B5E8C2D-FCFE-41F8-AC0E-EBEE4FE2DAB9@.microsoft.com...
> I changed the code as you described and it is working fine. However, the
expression has to be in every dataopint in the RDL file. I tried to change
and test what happens if I change the code going to "Chart
properties/data/values/".
> There is only the first expression and if I change it the whole chart does
not work anymore. It seems to me I can not do anything in that section
because the chart will not work. If I could make some changes I would trie
to use a code with a loop to get the 24 "hour bars".
> How can I use the expression one time? Is it e.g. possible to make a
function, in the code window or an assembly, with a loop so the code is
written 24 times to the RDL file by calling that function in the RDL file?
This way I only have to make changes in the function. Or is there an other
possiblity?
> "Robert Bruckner [MSFT]" wrote:
> > The CategoryGroupings section of the RDL file seems correct.
> > However, you also need to change the structure of the ChartData section.
> > Rather than 1 Datapoint per ChartSeries element and 24 ChartSeries
elements
> > in the entire file (i.e. 24 static series), you need to have just 1
> > ChartSeries element which contains 1 DataPoints element with 24
DataPoint
> > elements (i.e. 24 static categories).
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> >
> >
> > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > news:F481ACB9-1C7F-49E1-873E-46F35AE8FC94@.microsoft.com...
> > > I tried alternative (1). I did not succeed after making the convert. I
get
> > the following 2 error messages:
> > >
> > > C:\.....\filename.rdl The chart 'chart1' contains a different number
of
> > ChartSeries elements than the number of StaticSeries elements. If the
chart
> > contains no StaticSeries, it must contain one ChartSeries.
> > >
> > > C:\.....\filename.rdl The chart 'chart1' contains a different number
of
> > DataPoints per ChartSeries element than the number of StaticCategory
> > elements. If the chart contains no StaticCategory, it must contain one
> > DataPoint per ChartSeries.
> > >
> > > This is the change I made in the rdl:
> > > <CategoryGroupings>
> > > <CategoryGrouping>
> > > <StaticCategories>
> > > <StaticMember>
> > > <Label>0</Label>
> > > </StaticMember>
> > >
> > > e.t.c. till 23
> > >
> > > <StaticMember>
> > > <Label>23</Label>
> > > </StaticMember>
> > > </StaticCategories>
> > > </CategoryGrouping>
> > > </CategoryGroupings>
> > >
> > > I think I also have to change the following code but I do not know
what
> > the changes have to be:
> > >
> > > <ChartData>
> > > <ChartSeries>
> > > <DataPoints>
> > > <DataPoint>
> > > <DataValues>
> > > <DataValue>
> > >
<Value>=Sum(iif(code.Inzet(0,Fields!TijdVan.Value,
> > Fields! TijdTot.Value) ,1,0))</Value>
> > > </DataValue>
> > > </DataValues>
> > > <DataLabel>
> > > <Value>0</Value>
> > > <Visible>true</Visible>
> > > </DataLabel>
> > > <Style>
> > > <BackgroundColor>Green</BackgroundColor>
> > > </Style>
> > > <Marker>
> > > <Size>6pt</Size>
> > > </Marker>
> > > </DataPoint>
> > > </DataPoints>
> > > </ChartSeries>
> > >
> > > till 23
> > >
> > > </ChartData>
> > >
> > > At this moment the code is not working with the new changes I made. Is
it
> > correct that I have to change the previous code? If so, how? Is there
> > something else a matter why it is not working?
> > >
> > > Paco
> > >
> > >
> > >
> > > "Robert Bruckner [MSFT]" wrote:
> > >
> > > > These are the alternatives you have:
> > > >
> > > > (1) In order to have the X-axis show values from 0 to 23 you would
need
> > use
> > > > "static category groups". This is supported in the RDL and on the
report
> > > > server, however currently not in the report design tool. Therefore
you
> > would
> > > > need to manually convert the 24 "values" (which are actually static
> > series
> > > > groups) into static category groups.
> > > >
> > > > (2) Write a stored procedure that converts the current data storage
> > > > structure from 1 row containing TimeStart, TimeFinish into one row
per
> > e.g.
> > > > work hour or work quarter. Then you could simply create a chart
based on
> > the
> > > > stored procedure dataset with a category grouping =Fields!WorkHour,
no
> > > > series grouping, and a value of =Count(Fields!EmployeeID.Value). For
the
> > > > X-axis you would turn on "Numeric or time-scale values" and set a
> > minimum of
> > > > 0 and a maximum of 24.
> > > >
> > > > --
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > >
> > > >
> > > >
> > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > news:90C876F0-7438-4675-9A27-66931E6D0C02@.microsoft.com...
> > > > > I have two problems with the barchart I made. I made the barchart
with
> > > > data that
> > > > > I could not read immediately from the Database. The requiered data
has
> > to
> > > > be
> > > > > calculated by reading data from the database and using a function
> > which I
> > > > > placed in the "Code" window.
> > > > > The bar chart I made calculates how many employees are working
during
> > a
> > > > period.
> > > > > One day is displayed as 24 bars, one bar for every hour.
> > > > >
> > > > > If e.g. an employee works from 7:30 till 16:30, the barchart shows
> > from
> > > > the hour
> > > > > bar number 7 till number 16 one employee working. On the
(vertical)
> > Y-axis
> > > > you can
> > > > > see the number of employees and the (horizontal) x-axis should
display
> > the
> > > > hours
> > > > > starting by 0 till 23.
> > > > >
> > > > > The first problem is that the x-axis can not display anything.
This
> > has to
> > > > do with
> > > > > the fact that I am not using category groups. I this situation it
> > seems to
> > > > me that I can not use the category groups because it has no use at
all .
> > I
> > > > made for every hour bar a value in the "Chart properties" window
under
> > the
> > > > "Data" tab. So I made 24 values which I labeled from 0 till 23. The
> > point
> > > > labels are also from 0 till 23 so I can diplay that on the chart.
> > Otherwise
> > > > the values of the bars can not be read because the x-axis does not
show
> > > > them.
> > > > >
> > > > > I used the following expression for the bar 7:
> > > > > _____________________________________
> > > > > =Sum(iif(code.WorkingTime(7,Fields!TimeStart.Value,
> > > > Fields!TimeFinish.Value) ,1,0))
> > > > > _____________________________________
> > > > >
> > > > > For the other bars the number 7 is being adjusted to the according
> > hour.
> > > > > The TimeStart and TimeFinish are "Dates" in the database where I
can
> > > > extract
> > > > > the necessary information.
> > > > >
> > > > > I used the following function in the "Code" window to extraxt the
> > working
> > > > time of an employee.
> > > > > ___________________________________________
> > > > > Public Function WorkingTime(ByVal valHour As Integer, ByVal
> > valTimeStart
> > > > As Date, ByVal valTimeFinish As Date) As Boolean
> > > > > Dim StartHour, EndHour, EndMinutes
> > > > > StartHour = DatePart(DateInterval.Hour, valTimeStart)
> > > > > EndHour = DatePart(DateInterval.Hour, valTimeFinish)
> > > > > EndMinutes = DatePart(DateInterval.Minute, valTimeFinish)
> > > > >
> > > > > If (StartHour < (valhour + 1)) And _
> > > > > ((EndHour > valhour) or _
> > > > > (Endhour = valHour And EndMinutes <> 0)) Then
> > > > > Return True
> > > > > End If
> > > > > End Function
> > > > > _______________________________________________
> > > > >
> > > > > Everything is working but I am not satisfied with two issues and I
> > like to
> > > > know if
> > > > > there are solutions for it. My quesions are:
> > > > > 1. How can I display on the horizontal x-axis the hours from 0 to
23
> > in
> > > > the specific
> > > > > situation I explained or in a way that the same goal is being
> > achieved?
> > > > > 2. How can i make the code easier to mantain? Now I have to fill
in
> > for
> > > > > every hour the expression, that is 24 times. Is there a simpeler
way?
> > > > > I ask this because I probably have to expand this chart, the
client
> > > > > like to see the information on a 15 minutes basis. This means I
will
> > > > > have to fill in (24 X 4 =) 96 times the same expression.
> > > > >
> > > > > Thanks in advance for any help.
> > > > >
> > > > > Paco
> > > >
> > > >
> > > >
> >
> >
> >|||I succeeded with the stored procedure. I also had to make a "user definded function" and it is all working fine now.
There is one problem. Before I had the hour bars in two different colors (green, red), the first bar was green and the second red etc. In this way you can see them better.
They way I made it now they can have only one color (also a gradient). Is it possible to give the bars different colors like e.g the first bar is green and the second is red etc? The bars are then better to be differentiated. Also if it is printed (black & white) you can see the bars better by having different colors (green, red = light, dark).
I hope someone can help me with this one.
"Robert Bruckner [MSFT]" wrote:
> If you use "static categories", then as I mentioned in my first posting, you
> can no longer modify the report in the report designer because it does _not_
> support it - only the server supports it right now. If you load it in report
> designer and modify any property it will destroy the original changes. Just
> upload the modified RDL on the server and it will work.
> Also, as indicated in the other post, you will need 24 static categories and
> therefore have 24 datapoints (1 datapoint per static category). The only
> thing you gained by approach (1) is to have control over the X-axis.
> If you just want to have 1 datapoint expression, then you have to use
> approach (2). As described earlier, you will need to write a stored
> procedure and change the structure of the dataset. Then you will then just
> have 1 datapoint defined with =Count(Fields!EmployeeID.Value) and 1 dynamic
> category grouping =Fields!WorkHour.Value, which will automatically group the
> data per workhour.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Paco" <Paco@.discussions.microsoft.com> wrote in message
> news:1B5E8C2D-FCFE-41F8-AC0E-EBEE4FE2DAB9@.microsoft.com...
> > I changed the code as you described and it is working fine. However, the
> expression has to be in every dataopint in the RDL file. I tried to change
> and test what happens if I change the code going to "Chart
> properties/data/values/".
> > There is only the first expression and if I change it the whole chart does
> not work anymore. It seems to me I can not do anything in that section
> because the chart will not work. If I could make some changes I would trie
> to use a code with a loop to get the 24 "hour bars".
> >
> > How can I use the expression one time? Is it e.g. possible to make a
> function, in the code window or an assembly, with a loop so the code is
> written 24 times to the RDL file by calling that function in the RDL file?
> This way I only have to make changes in the function. Or is there an other
> possiblity?
> >
> > "Robert Bruckner [MSFT]" wrote:
> >
> > > The CategoryGroupings section of the RDL file seems correct.
> > > However, you also need to change the structure of the ChartData section.
> > > Rather than 1 Datapoint per ChartSeries element and 24 ChartSeries
> elements
> > > in the entire file (i.e. 24 static series), you need to have just 1
> > > ChartSeries element which contains 1 DataPoints element with 24
> DataPoint
> > > elements (i.e. 24 static categories).
> > >
> > > --
> > > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > >
> > >
> > >
> > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > news:F481ACB9-1C7F-49E1-873E-46F35AE8FC94@.microsoft.com...
> > > > I tried alternative (1). I did not succeed after making the convert. I
> get
> > > the following 2 error messages:
> > > >
> > > > C:\.....\filename.rdl The chart 'chart1' contains a different number
> of
> > > ChartSeries elements than the number of StaticSeries elements. If the
> chart
> > > contains no StaticSeries, it must contain one ChartSeries.
> > > >
> > > > C:\.....\filename.rdl The chart 'chart1' contains a different number
> of
> > > DataPoints per ChartSeries element than the number of StaticCategory
> > > elements. If the chart contains no StaticCategory, it must contain one
> > > DataPoint per ChartSeries.
> > > >
> > > > This is the change I made in the rdl:
> > > > <CategoryGroupings>
> > > > <CategoryGrouping>
> > > > <StaticCategories>
> > > > <StaticMember>
> > > > <Label>0</Label>
> > > > </StaticMember>
> > > >
> > > > e.t.c. till 23
> > > >
> > > > <StaticMember>
> > > > <Label>23</Label>
> > > > </StaticMember>
> > > > </StaticCategories>
> > > > </CategoryGrouping>
> > > > </CategoryGroupings>
> > > >
> > > > I think I also have to change the following code but I do not know
> what
> > > the changes have to be:
> > > >
> > > > <ChartData>
> > > > <ChartSeries>
> > > > <DataPoints>
> > > > <DataPoint>
> > > > <DataValues>
> > > > <DataValue>
> > > >
> <Value>=Sum(iif(code.Inzet(0,Fields!TijdVan.Value,
> > > Fields! TijdTot.Value) ,1,0))</Value>
> > > > </DataValue>
> > > > </DataValues>
> > > > <DataLabel>
> > > > <Value>0</Value>
> > > > <Visible>true</Visible>
> > > > </DataLabel>
> > > > <Style>
> > > > <BackgroundColor>Green</BackgroundColor>
> > > > </Style>
> > > > <Marker>
> > > > <Size>6pt</Size>
> > > > </Marker>
> > > > </DataPoint>
> > > > </DataPoints>
> > > > </ChartSeries>
> > > >
> > > > till 23
> > > >
> > > > </ChartData>
> > > >
> > > > At this moment the code is not working with the new changes I made. Is
> it
> > > correct that I have to change the previous code? If so, how? Is there
> > > something else a matter why it is not working?
> > > >
> > > > Paco
> > > >
> > > >
> > > >
> > > > "Robert Bruckner [MSFT]" wrote:
> > > >
> > > > > These are the alternatives you have:
> > > > >
> > > > > (1) In order to have the X-axis show values from 0 to 23 you would
> need
> > > use
> > > > > "static category groups". This is supported in the RDL and on the
> report
> > > > > server, however currently not in the report design tool. Therefore
> you
> > > would
> > > > > need to manually convert the 24 "values" (which are actually static
> > > series
> > > > > groups) into static category groups.
> > > > >
> > > > > (2) Write a stored procedure that converts the current data storage
> > > > > structure from 1 row containing TimeStart, TimeFinish into one row
> per
> > > e.g.
> > > > > work hour or work quarter. Then you could simply create a chart
> based on
> > > the
> > > > > stored procedure dataset with a category grouping =Fields!WorkHour,
> no
> > > > > series grouping, and a value of =Count(Fields!EmployeeID.Value). For
> the
> > > > > X-axis you would turn on "Numeric or time-scale values" and set a
> > > minimum of
> > > > > 0 and a maximum of 24.
> > > > >
> > > > > --
> > > > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
> > > > >
> > > > >
> > > > >
> > > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > > news:90C876F0-7438-4675-9A27-66931E6D0C02@.microsoft.com...
> > > > > > I have two problems with the barchart I made. I made the barchart
> with
> > > > > data that
> > > > > > I could not read immediately from the Database. The requiered data
> has
> > > to
> > > > > be
> > > > > > calculated by reading data from the database and using a function
> > > which I
> > > > > > placed in the "Code" window.
> > > > > > The bar chart I made calculates how many employees are working
> during
> > > a
> > > > > period.
> > > > > > One day is displayed as 24 bars, one bar for every hour.
> > > > > >
> > > > > > If e.g. an employee works from 7:30 till 16:30, the barchart shows
> > > from
> > > > > the hour
> > > > > > bar number 7 till number 16 one employee working. On the
> (vertical)
> > > Y-axis
> > > > > you can
> > > > > > see the number of employees and the (horizontal) x-axis should
> display
> > > the
> > > > > hours
> > > > > > starting by 0 till 23.
> > > > > >
> > > > > > The first problem is that the x-axis can not display anything.
> This
> > > has to
> > > > > do with
> > > > > > the fact that I am not using category groups. I this situation it
> > > seems to
> > > > > me that I can not use the category groups because it has no use at
> all .
> > > I
> > > > > made for every hour bar a value in the "Chart properties" window
> under
> > > the
> > > > > "Data" tab. So I made 24 values which I labeled from 0 till 23. The
> > > point
> > > > > labels are also from 0 till 23 so I can diplay that on the chart.
> > > Otherwise
> > > > > the values of the bars can not be read because the x-axis does not
> show
> > > > > them.
> > > > > >
> > > > > > I used the following expression for the bar 7:
> > > > > > _____________________________________
> > > > > > =Sum(iif(code.WorkingTime(7,Fields!TimeStart.Value,
> > > > > Fields!TimeFinish.Value) ,1,0))
> > > > > > _____________________________________
> > > > > >
> > > > > > For the other bars the number 7 is being adjusted to the according
> > > hour.
> > > > > > The TimeStart and TimeFinish are "Dates" in the database where I
> can
> > > > > extract
> > > > > > the necessary information.
> > > > > >
> > > > > > I used the following function in the "Code" window to extraxt the
> > > working
> > > > > time of an employee.
> > > > > > ___________________________________________
> > > > > > Public Function WorkingTime(ByVal valHour As Integer, ByVal
> > > valTimeStart
> > > > > As Date, ByVal valTimeFinish As Date) As Boolean
> > > > > > Dim StartHour, EndHour, EndMinutes
> > > > > > StartHour = DatePart(DateInterval.Hour, valTimeStart)
> > > > > > EndHour = DatePart(DateInterval.Hour, valTimeFinish)
> > > > > > EndMinutes = DatePart(DateInterval.Minute, valTimeFinish)
> > > > > >
> > > > > > If (StartHour < (valhour + 1)) And _
> > > > > > ((EndHour > valhour) or _
> > > > > > (Endhour = valHour And EndMinutes <> 0)) Then
> > > > > > Return True
> > > > > > End If
> > > > > > End Function
> > > > > > _______________________________________________
> > > > > >
> > > > > > Everything is working but I am not satisfied with two issues and I
> > > like to
> > > > > know if
> > > > > > there are solutions for it. My quesions are:
> > > > > > 1. How can I display on the horizontal x-axis the hours from 0 to
> 23
> > > in
> > > > > the specific
> > > > > > situation I explained or in a way that the same goal is being
> > > achieved?
> > > > > > 2. How can i make the code easier to mantain? Now I have to fill
> in
> > > for
> > > > > > every hour the expression, that is 24 times. Is there a simpeler
> way?
> > > > > > I ask this because I probably have to expand this chart, the
> client
> > > > > > like to see the information on a 15 minutes basis. This means I
> will
> > > > > > have to fill in (24 X 4 =) 96 times the same expression.
> > > > > >
> > > > > > Thanks in advance for any help.
> > > > > >
> > > > > > Paco
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||If you use SP1, you have control over the datapoint colors.
Assuming you have a category grouping like =Fields!WorkHour.Value and no
dynamic series grouping, you can write an expression for the datapoint color
()
=Choose(CInt(Fields!WorkHour.Value), "Green", "Blue", "Yellow", ......)
MSDN docs for Choose:
http://msdn.microsoft.com/library/en-us/vblr7/html/vafctchoose.asp
Alternatively, you can calculate some RGB values based on the WorkHour
value. Note: color expressions have to evaluate to strings, therefore you
have to convert the RGB value into a string like this:
=String.Format("#{0:x6}", RGB(CInt(Fields!WorkHour.Value) * 5, 1, 96))
MSDN docs for RGB:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctrgb.asp
Note: if you use a dynamic series grouping in the chart, you have to use an
aggregate function using the name of the dynamic series grouping as scope
when refering to WorkHour. Examples:
=Choose(CInt(First(Fields!WorkHour.Value, "SeriesGroupName")), "Green",
"Blue", "Yellow", ......)
=String.Format("#{0:x6}", RGB(CInt(First(Fields!WorkHour.Value,
"SeriesGroupName")) * 5, 1, 96))
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Paco" <Paco@.discussions.microsoft.com> wrote in message
news:2A34BE66-ECF2-48A8-802D-49AD08D70598@.microsoft.com...
> I succeeded with the stored procedure. I also had to make a "user definded
function" and it is all working fine now.
> There is one problem. Before I had the hour bars in two different colors
(green, red), the first bar was green and the second red etc. In this way
you can see them better.
> They way I made it now they can have only one color (also a gradient). Is
it possible to give the bars different colors like e.g the first bar is
green and the second is red etc? The bars are then better to be
differentiated. Also if it is printed (black & white) you can see the bars
better by having different colors (green, red = light, dark).
> I hope someone can help me with this one.
> "Robert Bruckner [MSFT]" wrote:
> > If you use "static categories", then as I mentioned in my first posting,
you
> > can no longer modify the report in the report designer because it does
_not_
> > support it - only the server supports it right now. If you load it in
report
> > designer and modify any property it will destroy the original changes.
Just
> > upload the modified RDL on the server and it will work.
> > Also, as indicated in the other post, you will need 24 static categories
and
> > therefore have 24 datapoints (1 datapoint per static category). The only
> > thing you gained by approach (1) is to have control over the X-axis.
> >
> > If you just want to have 1 datapoint expression, then you have to use
> > approach (2). As described earlier, you will need to write a stored
> > procedure and change the structure of the dataset. Then you will then
just
> > have 1 datapoint defined with =Count(Fields!EmployeeID.Value) and 1
dynamic
> > category grouping =Fields!WorkHour.Value, which will automatically group
the
> > data per workhour.
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> >
> > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > news:1B5E8C2D-FCFE-41F8-AC0E-EBEE4FE2DAB9@.microsoft.com...
> > > I changed the code as you described and it is working fine. However,
the
> > expression has to be in every dataopint in the RDL file. I tried to
change
> > and test what happens if I change the code going to "Chart
> > properties/data/values/".
> > > There is only the first expression and if I change it the whole chart
does
> > not work anymore. It seems to me I can not do anything in that section
> > because the chart will not work. If I could make some changes I would
trie
> > to use a code with a loop to get the 24 "hour bars".
> > >
> > > How can I use the expression one time? Is it e.g. possible to make a
> > function, in the code window or an assembly, with a loop so the code is
> > written 24 times to the RDL file by calling that function in the RDL
file?
> > This way I only have to make changes in the function. Or is there an
other
> > possiblity?
> > >
> > > "Robert Bruckner [MSFT]" wrote:
> > >
> > > > The CategoryGroupings section of the RDL file seems correct.
> > > > However, you also need to change the structure of the ChartData
section.
> > > > Rather than 1 Datapoint per ChartSeries element and 24 ChartSeries
> > elements
> > > > in the entire file (i.e. 24 static series), you need to have just 1
> > > > ChartSeries element which contains 1 DataPoints element with 24
> > DataPoint
> > > > elements (i.e. 24 static categories).
> > > >
> > > > --
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > >
> > > >
> > > >
> > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > news:F481ACB9-1C7F-49E1-873E-46F35AE8FC94@.microsoft.com...
> > > > > I tried alternative (1). I did not succeed after making the
convert. I
> > get
> > > > the following 2 error messages:
> > > > >
> > > > > C:\.....\filename.rdl The chart 'chart1' contains a different
number
> > of
> > > > ChartSeries elements than the number of StaticSeries elements. If
the
> > chart
> > > > contains no StaticSeries, it must contain one ChartSeries.
> > > > >
> > > > > C:\.....\filename.rdl The chart 'chart1' contains a different
number
> > of
> > > > DataPoints per ChartSeries element than the number of StaticCategory
> > > > elements. If the chart contains no StaticCategory, it must contain
one
> > > > DataPoint per ChartSeries.
> > > > >
> > > > > This is the change I made in the rdl:
> > > > > <CategoryGroupings>
> > > > > <CategoryGrouping>
> > > > > <StaticCategories>
> > > > > <StaticMember>
> > > > > <Label>0</Label>
> > > > > </StaticMember>
> > > > >
> > > > > e.t.c. till 23
> > > > >
> > > > > <StaticMember>
> > > > > <Label>23</Label>
> > > > > </StaticMember>
> > > > > </StaticCategories>
> > > > > </CategoryGrouping>
> > > > > </CategoryGroupings>
> > > > >
> > > > > I think I also have to change the following code but I do not know
> > what
> > > > the changes have to be:
> > > > >
> > > > > <ChartData>
> > > > > <ChartSeries>
> > > > > <DataPoints>
> > > > > <DataPoint>
> > > > > <DataValues>
> > > > > <DataValue>
> > > > >
> > <Value>=Sum(iif(code.Inzet(0,Fields!TijdVan.Value,
> > > > Fields! TijdTot.Value) ,1,0))</Value>
> > > > > </DataValue>
> > > > > </DataValues>
> > > > > <DataLabel>
> > > > > <Value>0</Value>
> > > > > <Visible>true</Visible>
> > > > > </DataLabel>
> > > > > <Style>
> > > > > <BackgroundColor>Green</BackgroundColor>
> > > > > </Style>
> > > > > <Marker>
> > > > > <Size>6pt</Size>
> > > > > </Marker>
> > > > > </DataPoint>
> > > > > </DataPoints>
> > > > > </ChartSeries>
> > > > >
> > > > > till 23
> > > > >
> > > > > </ChartData>
> > > > >
> > > > > At this moment the code is not working with the new changes I
made. Is
> > it
> > > > correct that I have to change the previous code? If so, how? Is
there
> > > > something else a matter why it is not working?
> > > > >
> > > > > Paco
> > > > >
> > > > >
> > > > >
> > > > > "Robert Bruckner [MSFT]" wrote:
> > > > >
> > > > > > These are the alternatives you have:
> > > > > >
> > > > > > (1) In order to have the X-axis show values from 0 to 23 you
would
> > need
> > > > use
> > > > > > "static category groups". This is supported in the RDL and on
the
> > report
> > > > > > server, however currently not in the report design tool. Therefo
re
> > you
> > > > would
> > > > > > need to manually convert the 24 "values" (which are actually
static
> > > > series
> > > > > > groups) into static category groups.
> > > > > >
> > > > > > (2) Write a stored procedure that converts the current data
storage
> > > > > > structure from 1 row containing TimeStart, TimeFinish into one
row
> > per
> > > > e.g.
> > > > > > work hour or work quarter. Then you could simply create a chart
> > based on
> > > > the
> > > > > > stored procedure dataset with a category grouping
=Fields!WorkHour,
> > no
> > > > > > series grouping, and a value of =Count(Fields!EmployeeID.Value).
For
> > the
> > > > > > X-axis you would turn on "Numeric or time-scale values" and set
a
> > > > minimum of
> > > > > > 0 and a maximum of 24.
> > > > > >
> > > > > > --
> > > > > > This posting is provided "AS IS" with no warranties, and confers
no
> > > > rights.
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > > > news:90C876F0-7438-4675-9A27-66931E6D0C02@.microsoft.com...
> > > > > > > I have two problems with the barchart I made. I made the
barchart
> > with
> > > > > > data that
> > > > > > > I could not read immediately from the Database. The requiered
data
> > has
> > > > to
> > > > > > be
> > > > > > > calculated by reading data from the database and using a
function
> > > > which I
> > > > > > > placed in the "Code" window.
> > > > > > > The bar chart I made calculates how many employees are working
> > during
> > > > a
> > > > > > period.
> > > > > > > One day is displayed as 24 bars, one bar for every hour.
> > > > > > >
> > > > > > > If e.g. an employee works from 7:30 till 16:30, the barchart
shows
> > > > from
> > > > > > the hour
> > > > > > > bar number 7 till number 16 one employee working. On the
> > (vertical)
> > > > Y-axis
> > > > > > you can
> > > > > > > see the number of employees and the (horizontal) x-axis should
> > display
> > > > the
> > > > > > hours
> > > > > > > starting by 0 till 23.
> > > > > > >
> > > > > > > The first problem is that the x-axis can not display anything.
> > This
> > > > has to
> > > > > > do with
> > > > > > > the fact that I am not using category groups. I this situation
it
> > > > seems to
> > > > > > me that I can not use the category groups because it has no use
at
> > all .
> > > > I
> > > > > > made for every hour bar a value in the "Chart properties" window
> > under
> > > > the
> > > > > > "Data" tab. So I made 24 values which I labeled from 0 till 23.
The
> > > > point
> > > > > > labels are also from 0 till 23 so I can diplay that on the
chart.
> > > > Otherwise
> > > > > > the values of the bars can not be read because the x-axis does
not
> > show
> > > > > > them.
> > > > > > >
> > > > > > > I used the following expression for the bar 7:
> > > > > > > _____________________________________
> > > > > > > =Sum(iif(code.WorkingTime(7,Fields!TimeStart.Value,
> > > > > > Fields!TimeFinish.Value) ,1,0))
> > > > > > > _____________________________________
> > > > > > >
> > > > > > > For the other bars the number 7 is being adjusted to the
according
> > > > hour.
> > > > > > > The TimeStart and TimeFinish are "Dates" in the database where
I
> > can
> > > > > > extract
> > > > > > > the necessary information.
> > > > > > >
> > > > > > > I used the following function in the "Code" window to extraxt
the
> > > > working
> > > > > > time of an employee.
> > > > > > > ___________________________________________
> > > > > > > Public Function WorkingTime(ByVal valHour As Integer, ByVal
> > > > valTimeStart
> > > > > > As Date, ByVal valTimeFinish As Date) As Boolean
> > > > > > > Dim StartHour, EndHour, EndMinutes
> > > > > > > StartHour = DatePart(DateInterval.Hour, valTimeStart)
> > > > > > > EndHour = DatePart(DateInterval.Hour, valTimeFinish)
> > > > > > > EndMinutes = DatePart(DateInterval.Minute, valTimeFinish)
> > > > > > >
> > > > > > > If (StartHour < (valhour + 1)) And _
> > > > > > > ((EndHour > valhour) or _
> > > > > > > (Endhour = valHour And EndMinutes <> 0)) Then
> > > > > > > Return True
> > > > > > > End If
> > > > > > > End Function
> > > > > > > _______________________________________________
> > > > > > >
> > > > > > > Everything is working but I am not satisfied with two issues
and I
> > > > like to
> > > > > > know if
> > > > > > > there are solutions for it. My quesions are:
> > > > > > > 1. How can I display on the horizontal x-axis the hours from 0
to
> > 23
> > > > in
> > > > > > the specific
> > > > > > > situation I explained or in a way that the same goal is being
> > > > achieved?
> > > > > > > 2. How can i make the code easier to mantain? Now I have to
fill
> > in
> > > > for
> > > > > > > every hour the expression, that is 24 times. Is there a
simpeler
> > way?
> > > > > > > I ask this because I probably have to expand this chart, the
> > client
> > > > > > > like to see the information on a 15 minutes basis. This means
I
> > will
> > > > > > > have to fill in (24 X 4 =) 96 times the same expression.
> > > > > > >
> > > > > > > Thanks in advance for any help.
> > > > > > >
> > > > > > > Paco
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||I changed the function. Instead of an "If Then Else" statement I use now a select case. Works fine too.
Function BarColor(ByVal BarNumber) As String
Select Case (BarNumber Mod 4)
Case 0
BarColor = "Green"
Case 1
BarColor = "Orange"
Case 2
BarColor = "Red"
Case else
BarColor = "Blue"
End Select
End Function
"Paco" wrote:
> I tried to use the Choose function, I have SP1 installed. I have no dynamic series grouping so it should be straight forward. Just implement the code you sudjested : =Choose(CInt(Fields!WorkHour.Value), "Green", "Blue", "Yellow", ......) and adapt it a little bit. I did not get it to work, though.
> After a while I looked for an alternative. I wrote in the expression "=code.BarColor(Fields!WorkHour.value)
> I also wrote a function in the code window. The function "BarColor(BarNumber)" like:
> If (BarNumber Mod 4 = 0) then
> BarColor = "Green"
> elseif (BarNumber Mod 4 = 1) then
> BarColor = "Orange"
> elseif (BarNumber Mod 4 = 2) then
> BarColor = "Red"
> else
> BarColor = "Blue"
> End if
> This works fine. However I really do not understand why the "Choose" function wouldn't work.
> "Robert Bruckner [MSFT]" wrote:
> > If you use SP1, you have control over the datapoint colors.
> >
> > Assuming you have a category grouping like =Fields!WorkHour.Value and no
> > dynamic series grouping, you can write an expression for the datapoint color
> > ()
> > =Choose(CInt(Fields!WorkHour.Value), "Green", "Blue", "Yellow", ......)
> >
> > MSDN docs for Choose:
> > http://msdn.microsoft.com/library/en-us/vblr7/html/vafctchoose.asp
> >
> > Alternatively, you can calculate some RGB values based on the WorkHour
> > value. Note: color expressions have to evaluate to strings, therefore you
> > have to convert the RGB value into a string like this:
> > =String.Format("#{0:x6}", RGB(CInt(Fields!WorkHour.Value) * 5, 1, 96))
> >
> > MSDN docs for RGB:
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctrgb.asp
> >
> > Note: if you use a dynamic series grouping in the chart, you have to use an
> > aggregate function using the name of the dynamic series grouping as scope
> > when refering to WorkHour. Examples:
> > =Choose(CInt(First(Fields!WorkHour.Value, "SeriesGroupName")), "Green",
> > "Blue", "Yellow", ......)
> > =String.Format("#{0:x6}", RGB(CInt(First(Fields!WorkHour.Value,
> > "SeriesGroupName")) * 5, 1, 96))
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> >
> > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > news:2A34BE66-ECF2-48A8-802D-49AD08D70598@.microsoft.com...
> > > I succeeded with the stored procedure. I also had to make a "user definded
> > function" and it is all working fine now.
> > >
> > > There is one problem. Before I had the hour bars in two different colors
> > (green, red), the first bar was green and the second red etc. In this way
> > you can see them better.
> > > They way I made it now they can have only one color (also a gradient). Is
> > it possible to give the bars different colors like e.g the first bar is
> > green and the second is red etc? The bars are then better to be
> > differentiated. Also if it is printed (black & white) you can see the bars
> > better by having different colors (green, red = light, dark).
> > >
> > > I hope someone can help me with this one.
> > >
> > > "Robert Bruckner [MSFT]" wrote:
> > >
> > > > If you use "static categories", then as I mentioned in my first posting,
> > you
> > > > can no longer modify the report in the report designer because it does
> > _not_
> > > > support it - only the server supports it right now. If you load it in
> > report
> > > > designer and modify any property it will destroy the original changes.
> > Just
> > > > upload the modified RDL on the server and it will work.
> > > > Also, as indicated in the other post, you will need 24 static categories
> > and
> > > > therefore have 24 datapoints (1 datapoint per static category). The only
> > > > thing you gained by approach (1) is to have control over the X-axis.
> > > >
> > > > If you just want to have 1 datapoint expression, then you have to use
> > > > approach (2). As described earlier, you will need to write a stored
> > > > procedure and change the structure of the dataset. Then you will then
> > just
> > > > have 1 datapoint defined with =Count(Fields!EmployeeID.Value) and 1
> > dynamic
> > > > category grouping =Fields!WorkHour.Value, which will automatically group
> > the
> > > > data per workhour.
> > > >
> > > > --
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > >
> > > >
> > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > news:1B5E8C2D-FCFE-41F8-AC0E-EBEE4FE2DAB9@.microsoft.com...
> > > > > I changed the code as you described and it is working fine. However,
> > the
> > > > expression has to be in every dataopint in the RDL file. I tried to
> > change
> > > > and test what happens if I change the code going to "Chart
> > > > properties/data/values/".
> > > > > There is only the first expression and if I change it the whole chart
> > does
> > > > not work anymore. It seems to me I can not do anything in that section
> > > > because the chart will not work. If I could make some changes I would
> > trie
> > > > to use a code with a loop to get the 24 "hour bars".
> > > > >
> > > > > How can I use the expression one time? Is it e.g. possible to make a
> > > > function, in the code window or an assembly, with a loop so the code is
> > > > written 24 times to the RDL file by calling that function in the RDL
> > file?
> > > > This way I only have to make changes in the function. Or is there an
> > other
> > > > possiblity?
> > > > >
> > > > > "Robert Bruckner [MSFT]" wrote:
> > > > >
> > > > > > The CategoryGroupings section of the RDL file seems correct.
> > > > > > However, you also need to change the structure of the ChartData
> > section.
> > > > > > Rather than 1 Datapoint per ChartSeries element and 24 ChartSeries
> > > > elements
> > > > > > in the entire file (i.e. 24 static series), you need to have just 1
> > > > > > ChartSeries element which contains 1 DataPoints element with 24
> > > > DataPoint
> > > > > > elements (i.e. 24 static categories).
> > > > > >
> > > > > > --
> > > > > > This posting is provided "AS IS" with no warranties, and confers no
> > > > rights.
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > > > news:F481ACB9-1C7F-49E1-873E-46F35AE8FC94@.microsoft.com...
> > > > > > > I tried alternative (1). I did not succeed after making the
> > convert. I
> > > > get
> > > > > > the following 2 error messages:
> > > > > > >
> > > > > > > C:\.....\filename.rdl The chart 'chart1' contains a different
> > number
> > > > of
> > > > > > ChartSeries elements than the number of StaticSeries elements. If
> > the
> > > > chart
> > > > > > contains no StaticSeries, it must contain one ChartSeries.
> > > > > > >
> > > > > > > C:\.....\filename.rdl The chart 'chart1' contains a different
> > number
> > > > of
> > > > > > DataPoints per ChartSeries element than the number of StaticCategory
> > > > > > elements. If the chart contains no StaticCategory, it must contain
> > one
> > > > > > DataPoint per ChartSeries.
> > > > > > >
> > > > > > > This is the change I made in the rdl:
> > > > > > > <CategoryGroupings>
> > > > > > > <CategoryGrouping>
> > > > > > > <StaticCategories>
> > > > > > > <StaticMember>
> > > > > > > <Label>0</Label>
> > > > > > > </StaticMember>
> > > > > > >
> > > > > > > e.t.c. till 23
> > > > > > >
> > > > > > > <StaticMember>
> > > > > > > <Label>23</Label>
> > > > > > > </StaticMember>
> > > > > > > </StaticCategories>
> > > > > > > </CategoryGrouping>
> > > > > > > </CategoryGroupings>
> > > > > > >
> > > > > > > I think I also have to change the following code but I do not know
> > > > what
> > > > > > the changes have to be:
> > > > > > >
> > > > > > > <ChartData>
> > > > > > > <ChartSeries>
> > > > > > > <DataPoints>
> > > > > > > <DataPoint>
> > > > > > > <DataValues>
> > > > > > > <DataValue>
> > > > > > >
> > > > <Value>=Sum(iif(code.Inzet(0,Fields!TijdVan.Value,
> > > > > > Fields! TijdTot.Value) ,1,0))</Value>
> > > > > > > </DataValue>
> > > > > > > </DataValues>
> > > > > > > <DataLabel>
> > > > > > > <Value>0</Value>
> > > > > > > <Visible>true</Visible>
> > > > > > > </DataLabel>
> > > > > > > <Style>
> > > > > > > <BackgroundColor>Green</BackgroundColor>
> > > > > > > </Style>
> > > > > > > <Marker>
> > > > > > > <Size>6pt</Size>
> > > > > > > </Marker>
> > > > > > > </DataPoint>
> > > > > > > </DataPoints>
> > > > > > > </ChartSeries>
> > > > > > >
> > > > > > > till 23
> > > > > > >
> > > > > > > </ChartData>
> > > > > > >
> > > > > > > At this moment the code is not working with the new changes I
> > made. Is
> > > > it
> > > > > > correct that I have to change the previous code? If so, how? Is
> > there
> > > > > > something else a matter why it is not working?
> > > > > > >
> > > > > > > Paco
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > "Robert Bruckner [MSFT]" wrote:
> > > > > > >
> > > > > > > > These are the alternatives you have:
> > > > > > > >
> > > > > > > > (1) In order to have the X-axis show values from 0 to 23 you
> > would
> > > > need
> > > > > > use
> > > > > > > > "static category groups". This is supported in the RDL and on
> > the
> > > > report
> > > > > > > > server, however currently not in the report design tool. Therefo
> > re
> > > > you
> > > > > > would
> > > > > > > > need to manually convert the 24 "values" (which are actually
> > static
> > > > > > series
> > > > > > > > groups) into static category groups.
> > > > > > > >
> > > > > > > > (2) Write a stored procedure that converts the current data
> > storage
> > > > > > > > structure from 1 row containing TimeStart, TimeFinish into one
> > row
> > > > per
> > > > > > e.g.
> > > > > > > > work hour or work quarter. Then you could simply create a chart
> > > > based on
> > > > > > the
> > > > > > > > stored procedure dataset with a category grouping
> > =Fields!WorkHour,
> > > > no
> > > > > > > > series grouping, and a value of =Count(Fields!EmployeeID.Value).
> > For
> > > > the
> > > > > > > > X-axis you would turn on "Numeric or time-scale values" and set
> > a
> > > > > > minimum of
> > > > > > > > 0 and a maximum of 24.
> > > > > > > >
> > > > > > > > --
> > > > > > > > This posting is provided "AS IS" with no warranties, and confers
> > no
> > > > > > rights.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > > > > > news:90C876F0-7438-4675-9A27-66931E6D0C02@.microsoft.com...
> > > > > > > > > I have two problems with the barchart I made. I made the
> > barchart
> > > > with
> > > > > > > > data that
> > > > > > > > > I could not read immediately from the Database. The requiered
> > data
> > > > has
> > > > > > to
> > > > > > > > be
> > > > > > > > > calculated by reading data from the database and using a
> > function
> > > > > > which I
> > > > > > > > > placed in the "Code" window.
> > > > > > > > > The bar chart I made calculates how many employees are working
> > > > during
> > > > > > a
> > > > > > > > period.
> > > > > > > > > One day is displayed as 24 bars, one bar for every hour.
> > > > > > > > >
> > > > > > > > > If e.g. an employee works from 7:30 till 16:30, the barchart
> > shows
> > > > > > from
> > > > > > > > the hour
> > > > > > > > > bar number 7 till number 16 one employee working. On the
> > > > (vertical)
> > > > > > Y-axis
> > > > > > > > you can
> > > > > > > > > see the number of employees and the (horizontal) x-axis should
> > > > display
> > > > > > the
> > > > > > > > hours
> > > > > > > > > starting by 0 till 23.
> > > > > > > > >
> > > > > > > > > The first problem is that the x-axis can not display anything.
> > > > This
> > > > > > has to
> > > > > > > > do with
> > > > > > > > > the fact that I am not using category groups. I this situation
> > it
> > > > > > seems to
> > > > > > > > me that I can not use the category groups because it has no use
> > at
> > > > all .
> > > > > > I
> > > > > > > > made for every hour bar a value in the "Chart properties" window
> > > > under
> > > > > > the
> > > > > > > > "Data" tab. So I made 24 values which I labeled from 0 till 23.
> > The
> > > > > > point
> > > > > > > > labels are also from 0 till 23 so I can diplay that on the
> > chart.
> > > > > > Otherwise
> > > > > > > > the values of the bars can not be read because the x-axis does
> > not
> > > > show
> > > > > > > > them.
> > > > > > > > >
> > > > > > > > > I used the following expression for the bar 7:
> > > > > > > > > _____________________________________
> > > > > > > > > =Sum(iif(code.WorkingTime(7,Fields!TimeStart.Value,
> > > > > > > > Fields!TimeFinish.Value) ,1,0))
> > > > > > > > > _____________________________________
> > > > > > > > >
> > > > > > > > > For the other bars the number 7 is being adjusted to the
> > according
> > > > > > hour.
> > > > > > > > > The TimeStart and TimeFinish are "Dates" in the database where
> > I
> > > > can
> > > > > > > > extract
> > > > > > > > > the necessary information.
> > > > > > > > >
> > > > > > > > > I used the following function in the "Code" window to extraxt
> > the
> > > > > > working
> > > > > > > > time of an employee.
> > > > > > > > > ___________________________________________
> > > > > > > > > Public Function WorkingTime(ByVal valHour As Integer, ByVal
> > > > > > valTimeStart
> > > > > > > > As Date, ByVal valTimeFinish As Date) As Boolean
> > > > > > > > > Dim StartHour, EndHour, EndMinutes
> > > > > > > > > StartHour = DatePart(DateInterval.Hour, valTimeStart)
> > > > > > > > > EndHour = DatePart(DateInterval.Hour, valTimeFinish)
> > > > > > > > > EndMinutes = DatePart(DateInterval.Minute, valTimeFinish)
> > > > > > > > >
> > > > > > > > > If (StartHour < (valhour + 1)) And _
> > > > > > > > > ((EndHour > valhour) or _
> > > > > > > > > (Endhour = valHour And EndMinutes <> 0)) Then
> > > > > > > > > Return True
> > > > > > > > > End If
> > > > > > > > > End Function
> > > > > > > > > _______________________________________________
> > > > > > > > >
> > > > > > > > > Everything is working but I am not satisfied with two issues
> > and I
> > > > > > like to
> > > > > > > > know if
> > > > > > > > > there are solutions for it. My quesions are:
> > > > > > > > > 1. How can I display on the horizontal x-axis the hours from 0
> > to
> > > > 23
> > > > > > in
> > > > > > > > the specific
> > > > > > > > > situation I explained or in a way that the same goal is being
> > > > > > achieved?
> > > > > > > > > 2. How can i make the code easier to mantain? Now I have to
> > fill
> > > > in
> > > > > > for
> > > > > > > > > every hour the expression, that is 24 times. Is there a
> > simpeler
> > > > way?
> > > > > > > > > I ask this because I probably have to expand this chart, the
> > > > client
> > > > > > > > > like to see the information on a 15 minutes basis. This means
> > I
> > > > will
> > > > > > > > > have to fill in (24 X 4 =) 96 times the same expression.
> > > > > > > > >
> > > > > > > > > Thanks in advance for any help.
> > > > > > > > >
> > > > > > > > > Paco
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||I made my Barchart and it is working OK. There is however a difference in display when having different values that makes up the barchart and a barchart that is made up by a Category Group.
If I use the values, the barcharts are connected to each other and therefore they are thicker and better displayed compared to a barchart made up by a Category group. The bars made up by a Category group have a space between each other of appr. 30% of the bar width.
I looked at the pointwidth, but the value is 0 and if I change it then it gets only worse. I am using a barchart that displays 24 hours and every hour has 4 bars. The bars are already very small so I like to get rid of the spaces in between and make the bars wider. Are there possiblities to do this?
"Robert Bruckner [MSFT]" wrote:
> If you use SP1, you have control over the datapoint colors.
> Assuming you have a category grouping like =Fields!WorkHour.Value and no
> dynamic series grouping, you can write an expression for the datapoint color
> ()
> =Choose(CInt(Fields!WorkHour.Value), "Green", "Blue", "Yellow", ......)
> MSDN docs for Choose:
> http://msdn.microsoft.com/library/en-us/vblr7/html/vafctchoose.asp
> Alternatively, you can calculate some RGB values based on the WorkHour
> value. Note: color expressions have to evaluate to strings, therefore you
> have to convert the RGB value into a string like this:
> =String.Format("#{0:x6}", RGB(CInt(Fields!WorkHour.Value) * 5, 1, 96))
> MSDN docs for RGB:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctrgb.asp
> Note: if you use a dynamic series grouping in the chart, you have to use an
> aggregate function using the name of the dynamic series grouping as scope
> when refering to WorkHour. Examples:
> =Choose(CInt(First(Fields!WorkHour.Value, "SeriesGroupName")), "Green",
> "Blue", "Yellow", ......)
> =String.Format("#{0:x6}", RGB(CInt(First(Fields!WorkHour.Value,
> "SeriesGroupName")) * 5, 1, 96))
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Paco" <Paco@.discussions.microsoft.com> wrote in message
> news:2A34BE66-ECF2-48A8-802D-49AD08D70598@.microsoft.com...
> > I succeeded with the stored procedure. I also had to make a "user definded
> function" and it is all working fine now.
> >
> > There is one problem. Before I had the hour bars in two different colors
> (green, red), the first bar was green and the second red etc. In this way
> you can see them better.
> > They way I made it now they can have only one color (also a gradient). Is
> it possible to give the bars different colors like e.g the first bar is
> green and the second is red etc? The bars are then better to be
> differentiated. Also if it is printed (black & white) you can see the bars
> better by having different colors (green, red = light, dark).
> >
> > I hope someone can help me with this one.
> >
> > "Robert Bruckner [MSFT]" wrote:
> >
> > > If you use "static categories", then as I mentioned in my first posting,
> you
> > > can no longer modify the report in the report designer because it does
> _not_
> > > support it - only the server supports it right now. If you load it in
> report
> > > designer and modify any property it will destroy the original changes.
> Just
> > > upload the modified RDL on the server and it will work.
> > > Also, as indicated in the other post, you will need 24 static categories
> and
> > > therefore have 24 datapoints (1 datapoint per static category). The only
> > > thing you gained by approach (1) is to have control over the X-axis.
> > >
> > > If you just want to have 1 datapoint expression, then you have to use
> > > approach (2). As described earlier, you will need to write a stored
> > > procedure and change the structure of the dataset. Then you will then
> just
> > > have 1 datapoint defined with =Count(Fields!EmployeeID.Value) and 1
> dynamic
> > > category grouping =Fields!WorkHour.Value, which will automatically group
> the
> > > data per workhour.
> > >
> > > --
> > > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > >
> > >
> > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > news:1B5E8C2D-FCFE-41F8-AC0E-EBEE4FE2DAB9@.microsoft.com...
> > > > I changed the code as you described and it is working fine. However,
> the
> > > expression has to be in every dataopint in the RDL file. I tried to
> change
> > > and test what happens if I change the code going to "Chart
> > > properties/data/values/".
> > > > There is only the first expression and if I change it the whole chart
> does
> > > not work anymore. It seems to me I can not do anything in that section
> > > because the chart will not work. If I could make some changes I would
> trie
> > > to use a code with a loop to get the 24 "hour bars".
> > > >
> > > > How can I use the expression one time? Is it e.g. possible to make a
> > > function, in the code window or an assembly, with a loop so the code is
> > > written 24 times to the RDL file by calling that function in the RDL
> file?
> > > This way I only have to make changes in the function. Or is there an
> other
> > > possiblity?
> > > >
> > > > "Robert Bruckner [MSFT]" wrote:
> > > >
> > > > > The CategoryGroupings section of the RDL file seems correct.
> > > > > However, you also need to change the structure of the ChartData
> section.
> > > > > Rather than 1 Datapoint per ChartSeries element and 24 ChartSeries
> > > elements
> > > > > in the entire file (i.e. 24 static series), you need to have just 1
> > > > > ChartSeries element which contains 1 DataPoints element with 24
> > > DataPoint
> > > > > elements (i.e. 24 static categories).
> > > > >
> > > > > --
> > > > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
> > > > >
> > > > >
> > > > >
> > > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > > news:F481ACB9-1C7F-49E1-873E-46F35AE8FC94@.microsoft.com...
> > > > > > I tried alternative (1). I did not succeed after making the
> convert. I
> > > get
> > > > > the following 2 error messages:
> > > > > >
> > > > > > C:\.....\filename.rdl The chart 'chart1' contains a different
> number
> > > of
> > > > > ChartSeries elements than the number of StaticSeries elements. If
> the
> > > chart
> > > > > contains no StaticSeries, it must contain one ChartSeries.
> > > > > >
> > > > > > C:\.....\filename.rdl The chart 'chart1' contains a different
> number
> > > of
> > > > > DataPoints per ChartSeries element than the number of StaticCategory
> > > > > elements. If the chart contains no StaticCategory, it must contain
> one
> > > > > DataPoint per ChartSeries.
> > > > > >
> > > > > > This is the change I made in the rdl:
> > > > > > <CategoryGroupings>
> > > > > > <CategoryGrouping>
> > > > > > <StaticCategories>
> > > > > > <StaticMember>
> > > > > > <Label>0</Label>
> > > > > > </StaticMember>
> > > > > >
> > > > > > e.t.c. till 23
> > > > > >
> > > > > > <StaticMember>
> > > > > > <Label>23</Label>
> > > > > > </StaticMember>
> > > > > > </StaticCategories>
> > > > > > </CategoryGrouping>
> > > > > > </CategoryGroupings>
> > > > > >
> > > > > > I think I also have to change the following code but I do not know
> > > what
> > > > > the changes have to be:
> > > > > >
> > > > > > <ChartData>
> > > > > > <ChartSeries>
> > > > > > <DataPoints>
> > > > > > <DataPoint>
> > > > > > <DataValues>
> > > > > > <DataValue>
> > > > > >
> > > <Value>=Sum(iif(code.Inzet(0,Fields!TijdVan.Value,
> > > > > Fields! TijdTot.Value) ,1,0))</Value>
> > > > > > </DataValue>
> > > > > > </DataValues>
> > > > > > <DataLabel>
> > > > > > <Value>0</Value>
> > > > > > <Visible>true</Visible>
> > > > > > </DataLabel>
> > > > > > <Style>
> > > > > > <BackgroundColor>Green</BackgroundColor>
> > > > > > </Style>
> > > > > > <Marker>
> > > > > > <Size>6pt</Size>
> > > > > > </Marker>
> > > > > > </DataPoint>
> > > > > > </DataPoints>
> > > > > > </ChartSeries>
> > > > > >
> > > > > > till 23
> > > > > >
> > > > > > </ChartData>
> > > > > >
> > > > > > At this moment the code is not working with the new changes I
> made. Is
> > > it
> > > > > correct that I have to change the previous code? If so, how? Is
> there
> > > > > something else a matter why it is not working?
> > > > > >
> > > > > > Paco
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Robert Bruckner [MSFT]" wrote:
> > > > > >
> > > > > > > These are the alternatives you have:
> > > > > > >
> > > > > > > (1) In order to have the X-axis show values from 0 to 23 you
> would
> > > need
> > > > > use
> > > > > > > "static category groups". This is supported in the RDL and on
> the
> > > report
> > > > > > > server, however currently not in the report design tool. Therefo
> re
> > > you
> > > > > would
> > > > > > > need to manually convert the 24 "values" (which are actually
> static
> > > > > series
> > > > > > > groups) into static category groups.
> > > > > > >
> > > > > > > (2) Write a stored procedure that converts the current data
> storage
> > > > > > > structure from 1 row containing TimeStart, TimeFinish into one
> row
> > > per
> > > > > e.g.
> > > > > > > work hour or work quarter. Then you could simply create a chart
> > > based on
> > > > > the
> > > > > > > stored procedure dataset with a category grouping
> =Fields!WorkHour,
> > > no
> > > > > > > series grouping, and a value of =Count(Fields!EmployeeID.Value).
> For
> > > the
> > > > > > > X-axis you would turn on "Numeric or time-scale values" and set
> a
> > > > > minimum of
> > > > > > > 0 and a maximum of 24.
> > > > > > >
> > > > > > > --
> > > > > > > This posting is provided "AS IS" with no warranties, and confers
> no
> > > > > rights.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > > > > news:90C876F0-7438-4675-9A27-66931E6D0C02@.microsoft.com...
> > > > > > > > I have two problems with the barchart I made. I made the
> barchart
> > > with
> > > > > > > data that
> > > > > > > > I could not read immediately from the Database. The requiered
> data
> > > has
> > > > > to
> > > > > > > be
> > > > > > > > calculated by reading data from the database and using a
> function
> > > > > which I
> > > > > > > > placed in the "Code" window.
> > > > > > > > The bar chart I made calculates how many employees are working
> > > during
> > > > > a
> > > > > > > period.
> > > > > > > > One day is displayed as 24 bars, one bar for every hour.
> > > > > > > >
> > > > > > > > If e.g. an employee works from 7:30 till 16:30, the barchart
> shows
> > > > > from
> > > > > > > the hour
> > > > > > > > bar number 7 till number 16 one employee working. On the
> > > (vertical)
> > > > > Y-axis
> > > > > > > you can
> > > > > > > > see the number of employees and the (horizontal) x-axis should
> > > display
> > > > > the
> > > > > > > hours
> > > > > > > > starting by 0 till 23.
> > > > > > > >
> > > > > > > > The first problem is that the x-axis can not display anything.
> > > This
> > > > > has to
> > > > > > > do with
> > > > > > > > the fact that I am not using category groups. I this situation
> it
> > > > > seems to
> > > > > > > me that I can not use the category groups because it has no use
> at
> > > all .
> > > > > I
> > > > > > > made for every hour bar a value in the "Chart properties" window
> > > under
> > > > > the
> > > > > > > "Data" tab. So I made 24 values which I labeled from 0 till 23.
> The
> > > > > point
> > > > > > > labels are also from 0 till 23 so I can diplay that on the
> chart.
> > > > > Otherwise
> > > > > > > the values of the bars can not be read because the x-axis does
> not
> > > show
> > > > > > > them.
> > > > > > > >
> > > > > > > > I used the following expression for the bar 7:
> > > > > > > > _____________________________________
> > > > > > > > =Sum(iif(code.WorkingTime(7,Fields!TimeStart.Value,
> > > > > > > Fields!TimeFinish.Value) ,1,0))
> > > > > > > > _____________________________________
> > > > > > > >
> > > > > > > > For the other bars the number 7 is being adjusted to the
> according
> > > > > hour.
> > > > > > > > The TimeStart and TimeFinish are "Dates" in the database where
> I
> > > can
> > > > > > > extract
> > > > > > > > the necessary information.
> > > > > > > >
> > > > > > > > I used the following function in the "Code" window to extraxt
> the
> > > > > working
> > > > > > > time of an employee.
> > > > > > > > ___________________________________________
> > > > > > > > Public Function WorkingTime(ByVal valHour As Integer, ByVal
> > > > > valTimeStart
> > > > > > > As Date, ByVal valTimeFinish As Date) As Boolean
> > > > > > > > Dim StartHour, EndHour, EndMinutes
> > > > > > > > StartHour = DatePart(DateInterval.Hour, valTimeStart)
> > > > > > > > EndHour = DatePart(DateInterval.Hour, valTimeFinish)
> > > > > > > > EndMinutes = DatePart(DateInterval.Minute, valTimeFinish)
> > > > > > > >
> > > > > > > > If (StartHour < (valhour + 1)) And _
> > > > > > > > ((EndHour > valhour) or _
> > > > > > > > (Endhour = valHour And EndMinutes <> 0)) Then
> > > > > > > > Return True
> > > > > > > > End If
> > > > > > > > End Function
> > > > > > > > _______________________________________________
> > > > > > > >
> > > > > > > > Everything is working but I am not satisfied with two issues
> and I
> > > > > like to
> > > > > > > know if
> > > > > > > > there are solutions for it. My quesions are:
> > > > > > > > 1. How can I display on the horizontal x-axis the hours from 0
> to
> > > 23
> > > > > in
> > > > > > > the specific
> > > > > > > > situation I explained or in a way that the same goal is being
> > > > > achieved?
> > > > > > > > 2. How can i make the code easier to mantain? Now I have to
> fill
> > > in
> > > > > for
> > > > > > > > every hour the expression, that is 24 times. Is there a
> simpeler
> > > way?
> > > > > > > > I ask this because I probably have to expand this chart, the
> > > client
> > > > > > > > like to see the information on a 15 minutes basis. This means
> I
> > > will
> > > > > > > > have to fill in (24 X 4 =) 96 times the same expression.
> > > > > > > >
> > > > > > > > Thanks in advance for any help.
> > > > > > > >
> > > > > > > > Paco
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>|||"Values" represent static chart series. Every chart series is independent
(and has its own legend entry, its own default color etc.).
A (dynamic) category group will group the datapoints within one series.
Therefore, category groups share the same default color and many other
settings within the same chart series.
The Dundas chart control will automatically leave space between different
category groups - especially when you have category groups and multiple
chart series.
I'm not sure why the PointWidth property did not give the expected results.
Which values did you try? By default the internal PointWidth setting is 55,
unless explicitly set in the RDL file. You might want to try values close to
100. Note: the effect of the PointWidth setting is unfortunately not visible
in the chart layout mode, only in preview and server.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Paco" <Paco@.discussions.microsoft.com> wrote in message
news:BBB0A48A-8A1B-47B6-B0DB-FA2410D3E8EB@.microsoft.com...
> I made my Barchart and it is working OK. There is however a difference in
display when having different values that makes up the barchart and a
barchart that is made up by a Category Group.
> If I use the values, the barcharts are connected to each other and
therefore they are thicker and better displayed compared to a barchart made
up by a Category group. The bars made up by a Category group have a space
between each other of appr. 30% of the bar width.
> I looked at the pointwidth, but the value is 0 and if I change it then it
gets only worse. I am using a barchart that displays 24 hours and every hour
has 4 bars. The bars are already very small so I like to get rid of the
spaces in between and make the bars wider. Are there possiblities to do
this?
>
> "Robert Bruckner [MSFT]" wrote:
> > If you use SP1, you have control over the datapoint colors.
> >
> > Assuming you have a category grouping like =Fields!WorkHour.Value and no
> > dynamic series grouping, you can write an expression for the datapoint
color
> > ()
> > =Choose(CInt(Fields!WorkHour.Value), "Green", "Blue", "Yellow", ......)
> >
> > MSDN docs for Choose:
> > http://msdn.microsoft.com/library/en-us/vblr7/html/vafctchoose.asp
> >
> > Alternatively, you can calculate some RGB values based on the WorkHour
> > value. Note: color expressions have to evaluate to strings, therefore
you
> > have to convert the RGB value into a string like this:
> > =String.Format("#{0:x6}", RGB(CInt(Fields!WorkHour.Value) * 5, 1, 96))
> >
> > MSDN docs for RGB:
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctrgb.asp
> >
> > Note: if you use a dynamic series grouping in the chart, you have to use
an
> > aggregate function using the name of the dynamic series grouping as
scope
> > when refering to WorkHour. Examples:
> > =Choose(CInt(First(Fields!WorkHour.Value, "SeriesGroupName")), "Green",
> > "Blue", "Yellow", ......)
> > =String.Format("#{0:x6}", RGB(CInt(First(Fields!WorkHour.Value,
> > "SeriesGroupName")) * 5, 1, 96))
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> >
> > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > news:2A34BE66-ECF2-48A8-802D-49AD08D70598@.microsoft.com...
> > > I succeeded with the stored procedure. I also had to make a "user
definded
> > function" and it is all working fine now.
> > >
> > > There is one problem. Before I had the hour bars in two different
colors
> > (green, red), the first bar was green and the second red etc. In this
way
> > you can see them better.
> > > They way I made it now they can have only one color (also a gradient).
Is
> > it possible to give the bars different colors like e.g the first bar is
> > green and the second is red etc? The bars are then better to be
> > differentiated. Also if it is printed (black & white) you can see the
bars
> > better by having different colors (green, red = light, dark).
> > >
> > > I hope someone can help me with this one.
> > >
> > > "Robert Bruckner [MSFT]" wrote:
> > >
> > > > If you use "static categories", then as I mentioned in my first
posting,
> > you
> > > > can no longer modify the report in the report designer because it
does
> > _not_
> > > > support it - only the server supports it right now. If you load it
in
> > report
> > > > designer and modify any property it will destroy the original
changes.
> > Just
> > > > upload the modified RDL on the server and it will work.
> > > > Also, as indicated in the other post, you will need 24 static
categories
> > and
> > > > therefore have 24 datapoints (1 datapoint per static category). The
only
> > > > thing you gained by approach (1) is to have control over the X-axis.
> > > >
> > > > If you just want to have 1 datapoint expression, then you have to
use
> > > > approach (2). As described earlier, you will need to write a stored
> > > > procedure and change the structure of the dataset. Then you will
then
> > just
> > > > have 1 datapoint defined with =Count(Fields!EmployeeID.Value) and 1
> > dynamic
> > > > category grouping =Fields!WorkHour.Value, which will automatically
group
> > the
> > > > data per workhour.
> > > >
> > > > --
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > >
> > > >
> > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > news:1B5E8C2D-FCFE-41F8-AC0E-EBEE4FE2DAB9@.microsoft.com...
> > > > > I changed the code as you described and it is working fine.
However,
> > the
> > > > expression has to be in every dataopint in the RDL file. I tried to
> > change
> > > > and test what happens if I change the code going to "Chart
> > > > properties/data/values/".
> > > > > There is only the first expression and if I change it the whole
chart
> > does
> > > > not work anymore. It seems to me I can not do anything in that
section
> > > > because the chart will not work. If I could make some changes I
would
> > trie
> > > > to use a code with a loop to get the 24 "hour bars".
> > > > >
> > > > > How can I use the expression one time? Is it e.g. possible to make
a
> > > > function, in the code window or an assembly, with a loop so the code
is
> > > > written 24 times to the RDL file by calling that function in the RDL
> > file?
> > > > This way I only have to make changes in the function. Or is there an
> > other
> > > > possiblity?
> > > > >
> > > > > "Robert Bruckner [MSFT]" wrote:
> > > > >
> > > > > > The CategoryGroupings section of the RDL file seems correct.
> > > > > > However, you also need to change the structure of the ChartData
> > section.
> > > > > > Rather than 1 Datapoint per ChartSeries element and 24
ChartSeries
> > > > elements
> > > > > > in the entire file (i.e. 24 static series), you need to have
just 1
> > > > > > ChartSeries element which contains 1 DataPoints element with 24
> > > > DataPoint
> > > > > > elements (i.e. 24 static categories).
> > > > > >
> > > > > > --
> > > > > > This posting is provided "AS IS" with no warranties, and confers
no
> > > > rights.
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > > > news:F481ACB9-1C7F-49E1-873E-46F35AE8FC94@.microsoft.com...
> > > > > > > I tried alternative (1). I did not succeed after making the
> > convert. I
> > > > get
> > > > > > the following 2 error messages:
> > > > > > >
> > > > > > > C:\.....\filename.rdl The chart 'chart1' contains a different
> > number
> > > > of
> > > > > > ChartSeries elements than the number of StaticSeries elements.
If
> > the
> > > > chart
> > > > > > contains no StaticSeries, it must contain one ChartSeries.
> > > > > > >
> > > > > > > C:\.....\filename.rdl The chart 'chart1' contains a different
> > number
> > > > of
> > > > > > DataPoints per ChartSeries element than the number of
StaticCategory
> > > > > > elements. If the chart contains no StaticCategory, it must
contain
> > one
> > > > > > DataPoint per ChartSeries.
> > > > > > >
> > > > > > > This is the change I made in the rdl:
> > > > > > > <CategoryGroupings>
> > > > > > > <CategoryGrouping>
> > > > > > > <StaticCategories>
> > > > > > > <StaticMember>
> > > > > > > <Label>0</Label>
> > > > > > > </StaticMember>
> > > > > > >
> > > > > > > e.t.c. till 23
> > > > > > >
> > > > > > > <StaticMember>
> > > > > > > <Label>23</Label>
> > > > > > > </StaticMember>
> > > > > > > </StaticCategories>
> > > > > > > </CategoryGrouping>
> > > > > > > </CategoryGroupings>
> > > > > > >
> > > > > > > I think I also have to change the following code but I do not
know
> > > > what
> > > > > > the changes have to be:
> > > > > > >
> > > > > > > <ChartData>
> > > > > > > <ChartSeries>
> > > > > > > <DataPoints>
> > > > > > > <DataPoint>
> > > > > > > <DataValues>
> > > > > > > <DataValue>
> > > > > > >
> > > > <Value>=Sum(iif(code.Inzet(0,Fields!TijdVan.Value,
> > > > > > Fields! TijdTot.Value) ,1,0))</Value>
> > > > > > > </DataValue>
> > > > > > > </DataValues>
> > > > > > > <DataLabel>
> > > > > > > <Value>0</Value>
> > > > > > > <Visible>true</Visible>
> > > > > > > </DataLabel>
> > > > > > > <Style>
> > > > > > > <BackgroundColor>Green</BackgroundColor>
> > > > > > > </Style>
> > > > > > > <Marker>
> > > > > > > <Size>6pt</Size>
> > > > > > > </Marker>
> > > > > > > </DataPoint>
> > > > > > > </DataPoints>
> > > > > > > </ChartSeries>
> > > > > > >
> > > > > > > till 23
> > > > > > >
> > > > > > > </ChartData>
> > > > > > >
> > > > > > > At this moment the code is not working with the new changes I
> > made. Is
> > > > it
> > > > > > correct that I have to change the previous code? If so, how? Is
> > there
> > > > > > something else a matter why it is not working?
> > > > > > >
> > > > > > > Paco
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > "Robert Bruckner [MSFT]" wrote:
> > > > > > >
> > > > > > > > These are the alternatives you have:
> > > > > > > >
> > > > > > > > (1) In order to have the X-axis show values from 0 to 23 you
> > would
> > > > need
> > > > > > use
> > > > > > > > "static category groups". This is supported in the RDL and
on
> > the
> > > > report
> > > > > > > > server, however currently not in the report design tool.
Therefo
> > re
> > > > you
> > > > > > would
> > > > > > > > need to manually convert the 24 "values" (which are actually
> > static
> > > > > > series
> > > > > > > > groups) into static category groups.
> > > > > > > >
> > > > > > > > (2) Write a stored procedure that converts the current data
> > storage
> > > > > > > > structure from 1 row containing TimeStart, TimeFinish into
one
> > row
> > > > per
> > > > > > e.g.
> > > > > > > > work hour or work quarter. Then you could simply create a
chart
> > > > based on
> > > > > > the
> > > > > > > > stored procedure dataset with a category grouping
> > =Fields!WorkHour,
> > > > no
> > > > > > > > series grouping, and a value of
=Count(Fields!EmployeeID.Value).
> > For
> > > > the
> > > > > > > > X-axis you would turn on "Numeric or time-scale values" and
set
> > a
> > > > > > minimum of
> > > > > > > > 0 and a maximum of 24.
> > > > > > > >
> > > > > > > > --
> > > > > > > > This posting is provided "AS IS" with no warranties, and
confers
> > no
> > > > > > rights.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > > > > > news:90C876F0-7438-4675-9A27-66931E6D0C02@.microsoft.com...
> > > > > > > > > I have two problems with the barchart I made. I made the
> > barchart
> > > > with
> > > > > > > > data that
> > > > > > > > > I could not read immediately from the Database. The
requiered
> > data
> > > > has
> > > > > > to
> > > > > > > > be
> > > > > > > > > calculated by reading data from the database and using a
> > function
> > > > > > which I
> > > > > > > > > placed in the "Code" window.
> > > > > > > > > The bar chart I made calculates how many employees are
working
> > > > during
> > > > > > a
> > > > > > > > period.
> > > > > > > > > One day is displayed as 24 bars, one bar for every hour.
> > > > > > > > >
> > > > > > > > > If e.g. an employee works from 7:30 till 16:30, the
barchart
> > shows
> > > > > > from
> > > > > > > > the hour
> > > > > > > > > bar number 7 till number 16 one employee working. On the
> > > > (vertical)
> > > > > > Y-axis
> > > > > > > > you can
> > > > > > > > > see the number of employees and the (horizontal) x-axis
should
> > > > display
> > > > > > the
> > > > > > > > hours
> > > > > > > > > starting by 0 till 23.
> > > > > > > > >
> > > > > > > > > The first problem is that the x-axis can not display
anything.
> > > > This
> > > > > > has to
> > > > > > > > do with
> > > > > > > > > the fact that I am not using category groups. I this
situation
> > it
> > > > > > seems to
> > > > > > > > me that I can not use the category groups because it has no
use
> > at
> > > > all .
> > > > > > I
> > > > > > > > made for every hour bar a value in the "Chart properties"
window
> > > > under
> > > > > > the
> > > > > > > > "Data" tab. So I made 24 values which I labeled from 0 till
23.
> > The
> > > > > > point
> > > > > > > > labels are also from 0 till 23 so I can diplay that on the
> > chart.
> > > > > > Otherwise
> > > > > > > > the values of the bars can not be read because the x-axis
does
> > not
> > > > show
> > > > > > > > them.
> > > > > > > > >
> > > > > > > > > I used the following expression for the bar 7:
> > > > > > > > > _____________________________________
> > > > > > > > > =Sum(iif(code.WorkingTime(7,Fields!TimeStart.Value,
> > > > > > > > Fields!TimeFinish.Value) ,1,0))
> > > > > > > > > _____________________________________
> > > > > > > > >
> > > > > > > > > For the other bars the number 7 is being adjusted to the
> > according
> > > > > > hour.
> > > > > > > > > The TimeStart and TimeFinish are "Dates" in the database
where
> > I
> > > > can
> > > > > > > > extract
> > > > > > > > > the necessary information.
> > > > > > > > >
> > > > > > > > > I used the following function in the "Code" window to
extraxt
> > the
> > > > > > working
> > > > > > > > time of an employee.
> > > > > > > > > ___________________________________________
> > > > > > > > > Public Function WorkingTime(ByVal valHour As Integer,
ByVal
> > > > > > valTimeStart
> > > > > > > > As Date, ByVal valTimeFinish As Date) As Boolean
> > > > > > > > > Dim StartHour, EndHour, EndMinutes
> > > > > > > > > StartHour = DatePart(DateInterval.Hour, valTimeStart)
> > > > > > > > > EndHour = DatePart(DateInterval.Hour, valTimeFinish)
> > > > > > > > > EndMinutes = DatePart(DateInterval.Minute,
valTimeFinish)
> > > > > > > > >
> > > > > > > > > If (StartHour < (valhour + 1)) And _
> > > > > > > > > ((EndHour > valhour) or _
> > > > > > > > > (Endhour = valHour And EndMinutes <> 0)) Then
> > > > > > > > > Return True
> > > > > > > > > End If
> > > > > > > > > End Function
> > > > > > > > > _______________________________________________
> > > > > > > > >
> > > > > > > > > Everything is working but I am not satisfied with two
issues
> > and I
> > > > > > like to
> > > > > > > > know if
> > > > > > > > > there are solutions for it. My quesions are:
> > > > > > > > > 1. How can I display on the horizontal x-axis the hours
from 0
> > to
> > > > 23
> > > > > > in
> > > > > > > > the specific
> > > > > > > > > situation I explained or in a way that the same goal is
being
> > > > > > achieved?
> > > > > > > > > 2. How can i make the code easier to mantain? Now I have
to
> > fill
> > > > in
> > > > > > for
> > > > > > > > > every hour the expression, that is 24 times. Is there a
> > simpeler
> > > > way?
> > > > > > > > > I ask this because I probably have to expand this chart,
the
> > > > client
> > > > > > > > > like to see the information on a 15 minutes basis. This
means
> > I
> > > > will
> > > > > > > > > have to fill in (24 X 4 =) 96 times the same expression.
> > > > > > > > >
> > > > > > > > > Thanks in advance for any help.
> > > > > > > > >
> > > > > > > > > Paco
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >|||OK, I did not give it enough tries before.
I tried 100 and it is working now.
Thanks
"Robert Bruckner [MSFT]" wrote:
> "Values" represent static chart series. Every chart series is independent
> (and has its own legend entry, its own default color etc.).
> A (dynamic) category group will group the datapoints within one series.
> Therefore, category groups share the same default color and many other
> settings within the same chart series.
> The Dundas chart control will automatically leave space between different
> category groups - especially when you have category groups and multiple
> chart series.
> I'm not sure why the PointWidth property did not give the expected results.
> Which values did you try? By default the internal PointWidth setting is 55,
> unless explicitly set in the RDL file. You might want to try values close to
> 100. Note: the effect of the PointWidth setting is unfortunately not visible
> in the chart layout mode, only in preview and server.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Paco" <Paco@.discussions.microsoft.com> wrote in message
> news:BBB0A48A-8A1B-47B6-B0DB-FA2410D3E8EB@.microsoft.com...
> > I made my Barchart and it is working OK. There is however a difference in
> display when having different values that makes up the barchart and a
> barchart that is made up by a Category Group.
> > If I use the values, the barcharts are connected to each other and
> therefore they are thicker and better displayed compared to a barchart made
> up by a Category group. The bars made up by a Category group have a space
> between each other of appr. 30% of the bar width.
> > I looked at the pointwidth, but the value is 0 and if I change it then it
> gets only worse. I am using a barchart that displays 24 hours and every hour
> has 4 bars. The bars are already very small so I like to get rid of the
> spaces in between and make the bars wider. Are there possiblities to do
> this?
> >
> >
> >
> > "Robert Bruckner [MSFT]" wrote:
> >
> > > If you use SP1, you have control over the datapoint colors.
> > >
> > > Assuming you have a category grouping like =Fields!WorkHour.Value and no
> > > dynamic series grouping, you can write an expression for the datapoint
> color
> > > ()
> > > =Choose(CInt(Fields!WorkHour.Value), "Green", "Blue", "Yellow", ......)
> > >
> > > MSDN docs for Choose:
> > > http://msdn.microsoft.com/library/en-us/vblr7/html/vafctchoose.asp
> > >
> > > Alternatively, you can calculate some RGB values based on the WorkHour
> > > value. Note: color expressions have to evaluate to strings, therefore
> you
> > > have to convert the RGB value into a string like this:
> > > =String.Format("#{0:x6}", RGB(CInt(Fields!WorkHour.Value) * 5, 1, 96))
> > >
> > > MSDN docs for RGB:
> > >
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctrgb.asp
> > >
> > > Note: if you use a dynamic series grouping in the chart, you have to use
> an
> > > aggregate function using the name of the dynamic series grouping as
> scope
> > > when refering to WorkHour. Examples:
> > > =Choose(CInt(First(Fields!WorkHour.Value, "SeriesGroupName")), "Green",
> > > "Blue", "Yellow", ......)
> > > =String.Format("#{0:x6}", RGB(CInt(First(Fields!WorkHour.Value,
> > > "SeriesGroupName")) * 5, 1, 96))
> > >
> > > --
> > > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > >
> > >
> > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > news:2A34BE66-ECF2-48A8-802D-49AD08D70598@.microsoft.com...
> > > > I succeeded with the stored procedure. I also had to make a "user
> definded
> > > function" and it is all working fine now.
> > > >
> > > > There is one problem. Before I had the hour bars in two different
> colors
> > > (green, red), the first bar was green and the second red etc. In this
> way
> > > you can see them better.
> > > > They way I made it now they can have only one color (also a gradient).
> Is
> > > it possible to give the bars different colors like e.g the first bar is
> > > green and the second is red etc? The bars are then better to be
> > > differentiated. Also if it is printed (black & white) you can see the
> bars
> > > better by having different colors (green, red = light, dark).
> > > >
> > > > I hope someone can help me with this one.
> > > >
> > > > "Robert Bruckner [MSFT]" wrote:
> > > >
> > > > > If you use "static categories", then as I mentioned in my first
> posting,
> > > you
> > > > > can no longer modify the report in the report designer because it
> does
> > > _not_
> > > > > support it - only the server supports it right now. If you load it
> in
> > > report
> > > > > designer and modify any property it will destroy the original
> changes.
> > > Just
> > > > > upload the modified RDL on the server and it will work.
> > > > > Also, as indicated in the other post, you will need 24 static
> categories
> > > and
> > > > > therefore have 24 datapoints (1 datapoint per static category). The
> only
> > > > > thing you gained by approach (1) is to have control over the X-axis.
> > > > >
> > > > > If you just want to have 1 datapoint expression, then you have to
> use
> > > > > approach (2). As described earlier, you will need to write a stored
> > > > > procedure and change the structure of the dataset. Then you will
> then
> > > just
> > > > > have 1 datapoint defined with =Count(Fields!EmployeeID.Value) and 1
> > > dynamic
> > > > > category grouping =Fields!WorkHour.Value, which will automatically
> group
> > > the
> > > > > data per workhour.
> > > > >
> > > > > --
> > > > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
> > > > >
> > > > >
> > > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > > news:1B5E8C2D-FCFE-41F8-AC0E-EBEE4FE2DAB9@.microsoft.com...
> > > > > > I changed the code as you described and it is working fine.
> However,
> > > the
> > > > > expression has to be in every dataopint in the RDL file. I tried to
> > > change
> > > > > and test what happens if I change the code going to "Chart
> > > > > properties/data/values/".
> > > > > > There is only the first expression and if I change it the whole
> chart
> > > does
> > > > > not work anymore. It seems to me I can not do anything in that
> section
> > > > > because the chart will not work. If I could make some changes I
> would
> > > trie
> > > > > to use a code with a loop to get the 24 "hour bars".
> > > > > >
> > > > > > How can I use the expression one time? Is it e.g. possible to make
> a
> > > > > function, in the code window or an assembly, with a loop so the code
> is
> > > > > written 24 times to the RDL file by calling that function in the RDL
> > > file?
> > > > > This way I only have to make changes in the function. Or is there an
> > > other
> > > > > possiblity?
> > > > > >
> > > > > > "Robert Bruckner [MSFT]" wrote:
> > > > > >
> > > > > > > The CategoryGroupings section of the RDL file seems correct.
> > > > > > > However, you also need to change the structure of the ChartData
> > > section.
> > > > > > > Rather than 1 Datapoint per ChartSeries element and 24
> ChartSeries
> > > > > elements
> > > > > > > in the entire file (i.e. 24 static series), you need to have
> just 1
> > > > > > > ChartSeries element which contains 1 DataPoints element with 24
> > > > > DataPoint
> > > > > > > elements (i.e. 24 static categories).
> > > > > > >
> > > > > > > --
> > > > > > > This posting is provided "AS IS" with no warranties, and confers
> no
> > > > > rights.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > > > > news:F481ACB9-1C7F-49E1-873E-46F35AE8FC94@.microsoft.com...
> > > > > > > > I tried alternative (1). I did not succeed after making the
> > > convert. I
> > > > > get
> > > > > > > the following 2 error messages:
> > > > > > > >
> > > > > > > > C:\.....\filename.rdl The chart 'chart1' contains a different
> > > number
> > > > > of
> > > > > > > ChartSeries elements than the number of StaticSeries elements.
> If
> > > the
> > > > > chart
> > > > > > > contains no StaticSeries, it must contain one ChartSeries.
> > > > > > > >
> > > > > > > > C:\.....\filename.rdl The chart 'chart1' contains a different
> > > number
> > > > > of
> > > > > > > DataPoints per ChartSeries element than the number of
> StaticCategory
> > > > > > > elements. If the chart contains no StaticCategory, it must
> contain
> > > one
> > > > > > > DataPoint per ChartSeries.
> > > > > > > >
> > > > > > > > This is the change I made in the rdl:
> > > > > > > > <CategoryGroupings>
> > > > > > > > <CategoryGrouping>
> > > > > > > > <StaticCategories>
> > > > > > > > <StaticMember>
> > > > > > > > <Label>0</Label>
> > > > > > > > </StaticMember>
> > > > > > > >
> > > > > > > > e.t.c. till 23
> > > > > > > >
> > > > > > > > <StaticMember>
> > > > > > > > <Label>23</Label>
> > > > > > > > </StaticMember>
> > > > > > > > </StaticCategories>
> > > > > > > > </CategoryGrouping>
> > > > > > > > </CategoryGroupings>
> > > > > > > >
> > > > > > > > I think I also have to change the following code but I do not
> know
> > > > > what
> > > > > > > the changes have to be:
> > > > > > > >
> > > > > > > > <ChartData>
> > > > > > > > <ChartSeries>
> > > > > > > > <DataPoints>
> > > > > > > > <DataPoint>
> > > > > > > > <DataValues>
> > > > > > > > <DataValue>
> > > > > > > >
> > > > > <Value>=Sum(iif(code.Inzet(0,Fields!TijdVan.Value,
> > > > > > > Fields! TijdTot.Value) ,1,0))</Value>
> > > > > > > > </DataValue>
> > > > > > > > </DataValues>
> > > > > > > > <DataLabel>
> > > > > > > > <Value>0</Value>
> > > > > > > > <Visible>true</Visible>
> > > > > > > > </DataLabel>
> > > > > > > > <Style>
> > > > > > > > <BackgroundColor>Green</BackgroundColor>
> > > > > > > > </Style>
> > > > > > > > <Marker>
> > > > > > > > <Size>6pt</Size>
> > > > > > > > </Marker>
> > > > > > > > </DataPoint>
> > > > > > > > </DataPoints>
> > > > > > > > </ChartSeries>
> > > > > > > >
> > > > > > > > till 23
> > > > > > > >
> > > > > > > > </ChartData>
> > > > > > > >
> > > > > > > > At this moment the code is not working with the new changes I
> > > made. Is
> > > > > it
> > > > > > > correct that I have to change the previous code? If so, how? Is
> > > there
> > > > > > > something else a matter why it is not working?
> > > > > > > >
> > > > > > > > Paco
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > "Robert Bruckner [MSFT]" wrote:
> > > > > > > >
> > > > > > > > > These are the alternatives you have:
> > > > > > > > >
> > > > > > > > > (1) In order to have the X-axis show values from 0 to 23 you
> > > would
> > > > > need
> > > > > > > use
> > > > > > > > > "static category groups". This is supported in the RDL and
> on
> > > the
> > > > > report
> > > > > > > > > server, however currently not in the report design tool.
> Therefo
> > > re
> > > > > you
> > > > > > > would
> > > > > > > > > need to manually convert the 24 "values" (which are actually
> > > static
> > > > > > > series
> > > > > > > > > groups) into static category groups.
> > > > > > > > >
> > > > > > > > > (2) Write a stored procedure that converts the current data
> > > storage
> > > > > > > > > structure from 1 row containing TimeStart, TimeFinish into
> one
> > > row
> > > > > per
> > > > > > > e.g.
> > > > > > > > > work hour or work quarter. Then you could simply create a
> chart
> > > > > based on
> > > > > > > the
> > > > > > > > > stored procedure dataset with a category grouping
> > > =Fields!WorkHour,
> > > > > no
> > > > > > > > > series grouping, and a value of
> =Count(Fields!EmployeeID.Value).
> > > For
> > > > > the
> > > > > > > > > X-axis you would turn on "Numeric or time-scale values" and
> set
> > > a
> > > > > > > minimum of
> > > > > > > > > 0 and a maximum of 24.
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > This posting is provided "AS IS" with no warranties, and
> confers
> > > no
> > > > > > > rights.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > "Paco" <Paco@.discussions.microsoft.com> wrote in message
> > > > > > > > > news:90C876F0-7438-4675-9A27-66931E6D0C02@.microsoft.com...
> > > > > > > > > > I have two problems with the barchart I made. I made the
> > > barchart
> > > > > with
> > > > > > > > > data that
> > > > > > > > > > I could not read immediately from the Database. The
> requiered
> > > data
> > > > > has
> > > > > > > to
> > > > > > > > > be
> > > > > > > > > > calculated by reading data from the database and using a
> > > function
> > > > > > > which I
> > > > > > > > > > placed in the "Code" window.
> > > > > > > > > > The bar chart I made calculates how many employees are
> working
> > > > > during
> > > > > > > a
> > > > > > > > > period.
> > > > > > > > > > One day is displayed as 24 bars, one bar for every hour.
> > > > > > > > > >
> > > > > > > > > > If e.g. an employee works from 7:30 till 16:30, the
> barchart
> > > shows
> > > > > > > from
> > > > > > > > > the hour
> > > > > > > > > > bar number 7 till number 16 one employee working. On the
> > > > > (vertical)
> > > > > > > Y-axis
> > > > > > > > > you can
> > > > > > > > > > see the number of employees and the (horizontal) x-axis
> should
> > > > > display
> > > > > > > the
> > > > > > > > > hours
> > > > > > > > > > starting by 0 till 23.
> > > > > > > > > >
> > > > > > > > > > The first problem is that the x-axis can not display
> anything.
> > > > > This
> > > > > > > has to
> > > > > > > > > do with
> > > > > > > > > > the fact that I am not using category groups. I this
> situation
> > > it
> > > > > > > seems to
> > > > > > > > > me that I can not use the category groups because it has no
> use
> > > at
> > > > > all .
> > > > > > > I
> > > > > > > > > made for every hour bar a value in the "Chart properties"
> window
> > > > > under
> > > > > > > the
> > > > > > > > > "Data" tab. So I made 24 values which I labeled from 0 till
> 23.
> > > The
> > > > > > > point
> > > > > > > > > labels are also from 0 till 23 so I can diplay that on the
> > > chart.
> > > > > > > Otherwise
> > > > > > > > > the values of the bars can not be read because the x-axis
> does
> > > not
> > > > > show
> > > > > > > > > them.
> > > > > > > > > >
> > > > > > > > > > I used the following expression for the bar 7:
> > > > > > > > > > _____________________________________
> > > > > > > > > > =Sum(iif(code.WorkingTime(7,Fields!TimeStart.Value,
> > > > > > > > > Fields!TimeFinish.Value) ,1,0))
> > > > > > > > > > _____________________________________
> > > > > > > > > >
> > > > > > > > > > For the other bars the number 7 is being adjusted to the
> > > according
> > > > > > > hour.
> > > > > > > > > > The TimeStart and TimeFinish are "Dates" in the database
> where
> > > I
> > > > > can
> > > > > > > > > extract
> > > > > > > > > > the necessary information.
> > > > > > > > > >
> > > > > > > > > > I used the following function in the "Code" window to
> extraxt
> > > the
> > > > > > > working
> > > > > > > > > time of an employee.
> > > > > > > > > > ___________________________________________
> > > > > > > > > > Public Function WorkingTime(ByVal valHour As Integer,
> ByVal
> > > > > > > valTimeStart
> > > > > > > > > As Date, ByVal valTimeFinish As Date) As Boolean
> > > > > > > > > > Dim StartHour, EndHour, EndMinutes
> > > > > > > > > > StartHour = DatePart(DateInterval.Hour, valTimeStart)
> > > > > > > > > > EndHour = DatePart(DateInterval.Hour, valTimeFinish)
> > > > > > > > > > EndMinutes = DatePart(DateInterval.Minute,
> valTimeFinish)
> > > > > > > > > >
> > > > > > > > > > If (StartHour < (valhour + 1)) And _
> > > > > > > > > > ((EndHour > valhour) or _
> > > > > > > > > > (Endhour = valHour And EndMinutes <> 0)) Then
> > > > > > > > > > Return True
> > > > > > > > > > End If
> > > > > > > > > > End Function
> > > > > > > > > > _______________________________________________
> > > > > > > > > >
> > > > > > > > > > Everything is working but I am not satisfied with two
> issues
> > > and I
> > > > > > > like to
> > > > > > > > > know if
> > > > > > > > > > there are solutions for it. My quesions are:
> > > > > > > > > > 1. How can I display on the horizontal x-axis the hours
> from 0
> > > to
> > > > > 23
> > > > > > > in
> > > > > > > > > the specific
> > > > > > > > > > situation I explained or in a way that the same goal is
> being
> > > > > > > achieved?
> > > > > > > > > > 2. How can i make the code easier to mantain? Now I have
> to
> > > fill
> > > > > in
> > > > > > > for
> > > > > > > > > > every hour the expression, that is 24 times. Is there a
> > > simpeler
> > > > > way?
> > > > > > > > > > I ask this because I probably have to expand this chart,
> the
> > > > > client
> > > > > > > > > > like to see the information on a 15 minutes basis. This
> means
> > > I
> > > > > will
> > > > > > > > > > have to fill in (24 X 4 =) 96 times the same expression.
> > > > > > > > > >
> > > > > > > > > > Thanks in advance for any help.
> > > > > > > > > >
> > > > > > > > > > Paco
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>