Showing posts with label draw. Show all posts
Showing posts with label draw. Show all posts

Thursday, March 29, 2012

Drawing line at last record

Hi.
I have a table containing two groups and a detail area.My report has multiple pages.I want to draw line after the last record on every page.I think that expression will be written in record's bottom expression area.How can I choose the last record in every page.Or is there another way to do this.Could you help me please?why wont u draw a line on page footer? when u draw a line on page footer it will diplay on the bottom of each page.|||Thanks but it didn't work
I drawed horizontal line across the page footer.
But there is several blank rows between the last record and the line in page footer.And this is never looking good.If you have another idea about this please share with me.

Draw rectancle with rounded corners

Is there a way to draw a rectangle that has rounded corners?
Thanks.On Jun 1, 9:36 am, "Tim Kelley" <tkel...@.company.com> wrote:
> Is there a way to draw a rectangle that has rounded corners?
> Thanks.
As far as I know, there is not. Sorry that I could not be of greater
assistance.
Regards,
Enrique Martinez
Sr. Software Consultant

Draw marking line on Chart

I want to mark a value on the x-axis of a (stacked) bar chart. (So I want a horizontal line that is fixed on a chart.)

What I tried so far is adding an expression that says: =260 to the dataset, and I added that field to the Data Area of the chart. Then I plotted that value as a line.

This approach leaves me with 2 problems:
1. When the category grouping only has one group, there is no line, just a dot (or another marker you can select).
2. Because of the extra field in the Data Area of the chart, the legend holds useless information.

Isn't there another way to plot a horizontal line on a fixed value of the X-axis ?

I also took some screenshots so you can see for yourself. The charts display the ManDays per Year. The green color are the productive days and the blue are the non productive. I made charts of how they look right now, and how I want them to look. http://users.telenet.be/master/ict/charts.html

Owkey I couldn't make the line go all the way through but I managed to edit the legend by an example of Brain Welcker on custom legends. It can be found here: http://blogs.msdn.com/bwelcker/archive/2005/05/20/420349.aspx

So to draw a straight marking line on a chart: Add a field to the dataset containing the value where there has to be marked. Add that field to the data area of the chart. Set it so it will be displayed as a line. Remove the legend. Add a custom legend.

|||

My first question is how you plotted that field values - let's say we say that field name is Target Value right, how you plot that value as a Line in Bar Graph, I can't see in the Data area of that chart.

Can you explain in detail.

Thanks

|||

When I click twice on the chart, I see 3 area's: The Data, Series and Category area. In my data area there are two fields. One field is a sum of a database field, so that will create the bars.

The other field is a calculated field with expression "= 260" (because that is the value I want to mark on the chart) the field is called Marker. This field is added to the dataset which is used by the chart.

Then when you have dragged that field onto the data area, double click it and check these settings:
On the Values tab: the value property is =Fields!Marker.Value (when field is called marker)
On the Appearance tab: check the "show markers" and "plot data as line" checkboxes. This will draw a line with height= 260 on the x-axis (horizontal).

I hope this is clear enough, otherwise let me know ;)

|||

I am using Crystal Report 8.5... you are doing the same activity on Sql Server Reporting service ?

Thanks

NOOR

Draw many to many relationship diagram

Does anyone how to draw many to many relationship diagram in Enterprise
Manager? It only allow me to draw one to many, but does not allow me to dra
w
many to many relationship.
Thanks!A many-to-many relationship in a relational model requires an intersection
table. For example:
People --> AssignedRoom <-- Rooms
AssignedRoom handles the intersection of many people assigned to many rooms,
with some being assigned to the same room.
RLF
"she" <she@.discussions.microsoft.com> wrote in message
news:65D409AD-1FC2-4ADB-8DB3-A61F7B6D1A80@.microsoft.com...
> Does anyone how to draw many to many relationship diagram in Enterprise
> Manager? It only allow me to draw one to many, but does not allow me to
> draw
> many to many relationship.
> Thanks!|||Thank you, Russell.
"Russell Fields" wrote:

> A many-to-many relationship in a relational model requires an intersection
> table. For example:
> People --> AssignedRoom <-- Rooms
> AssignedRoom handles the intersection of many people assigned to many room
s,
> with some being assigned to the same room.
>
> RLF
> "she" <she@.discussions.microsoft.com> wrote in message
> news:65D409AD-1FC2-4ADB-8DB3-A61F7B6D1A80@.microsoft.com...
>
>

Draw Horizontal Line at Threshold

I have a table in reporting services. I have a field that calcuates a
percentage and the report is sorted in ascending order by this
percentage. I want to draw a single red horizontal line at a
threshold, let's say 95% so that any record lower than 95% would be
above the line and any record higher would be below the line. How can
I do this?On Apr 4, 6:54 am, robertpet...@.hotmail.com wrote:
> I have a table in reporting services. I have a field that calcuates a
> percentage and the report is sorted in ascending order by this
> percentage. I want to draw a single red horizontal line at a
> threshold, let's say 95% so that any record lower than 95% would be
> above the line and any record higher would be below the line. How can
> I do this?
I would suggest adding an extra query/stored procedure return field/
column to include in the report that is used as a flag for the
percentages. Have the flag set for the minimum row at or above 95%.
Then in the report, set the table properties (F4) (BorderColor->Top
and BorderStyle->Top) according to that flag. Something like these
expressions should work:
For BorderColor:Top:
=iif(Fields!Flag.Value = 1, "Red", "White")
For BorderStyle:Top:
=iif(Fields!Flag.Value = 1, "Solid", "None")
Hope this is helpful.
Regards,
Enrique Martinez
Sr. Software Consultantsql

Draw Bitmap from Points in report

Hi, i have a database field that has a drawing stored as points, for example....

(x1,y1)(x2,x2)(x1,y1)(x2,x2)(x1,y1)(x2,x2)(x1,y1)(x2,x2)(x1,y1)(x2,x2)(x1,y1)(x2,x2)(x1,y1)(x2,x2)

In my VB.NET application, i can take those points and recreate the image. I need to do the same in reporting services... i am trying to replace a legacy ACCESS report, that had the drawing object.

How can i recreate the image in reporting services? is there an easy way to do so? i believe i tried to create a class and tried to reference it and call the function to return the data as an image, but i got a system.drawing not found error...

There are at least two options:

1. use the built-in charts with chart type = scatter. Note: the scatter chart must have a category grouping based on a unique value (e.g. data point id in your case). I attached a small sample report to the bottom of this posting to show the idea.

2. or draw the image yourself and use it in Reporting Services. However, make sure to follow these steps:

2.1. Design and implement a custom assembly to generate images.
The custom assembly must retrieve the data on its own, take care of grouping/sorting the data, and generating the chart image.
Note: The custom assembly has to return the image as byte[]. It cannot return it as a System.Drawing.Image. You can often convert a System.Drawing.Image object with code similar to the following.
System.IO.MemoryStream renderedImage = new MemoryStream();
myChart.Save(renderedImage);
renderedImage.Position = 0;
return renderedImage.ToArray();

2.2. Add an image to the report.
Set the image type to Database. If the generated image is a bitmap in the PNG image format, set the image mimetype property to “image/png.” For the image value property, use an expression like the following.
=MyCustomAssembly.GenerateChart()

2.3. View the report in Report Designer Preview view to verify that the report is working correctly.
Note: In a default configuration, custom assemblies run in FullTrust in Report Designer preview. Hence, operations that require certain code access security permissions (such as file input/output, data provide access, etc.) are automatically granted these permissions in Fulltrust.

2.4. Deploy the custom assembly on a report server.
Make sure that the security policy configuration of the report server grants sufficient permissions to your custom assembly at runtime; otherwise the image generation will fail. For more information, see Understanding Code Access Security in Reporting Services (http://msdn2.microsoft.com/en-us/library/ms155108.aspx) in SQL Server 2005 Books Online.

-- Robert

=========================================

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<DataSources>
<DataSource Name="AdventureWorks">
<DataSourceReference>AdventureWorks</DataSourceReference>
<rd:DataSourceID>67061ec4-b72e-4a04-a7f3-714536211b9c</rd:DataSourceID>
</DataSource>
</DataSources>
<BottomMargin>1in</BottomMargin>
<RightMargin>1in</RightMargin>
<rd:DrawGrid>true</rd:DrawGrid>
<InteractiveWidth>8.5in</InteractiveWidth>
<rd:SnapToGrid>true</rd:SnapToGrid>
<Body>
<ReportItems>
<Chart Name="chart1">
<Legend>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
<Position>RightCenter</Position>
</Legend>
<Subtype>Line</Subtype>
<Title />
<Height>2in</Height>
<CategoryAxis>
<Axis>
<Title />
<Style>
<Format>MMM dd</Format>
</Style>
<MajorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<Visible>true</Visible>
<Scalar>true</Scalar>
</Axis>
</CategoryAxis>
<PointWidth>0</PointWidth>
<Left>0.125in</Left>
<ThreeDProperties>
<Rotation>30</Rotation>
<Inclination>30</Inclination>
<Shading>Simple</Shading>
<WallThickness>50</WallThickness>
</ThreeDProperties>
<DataSetName>DataSet1</DataSetName>
<SeriesGroupings>
<SeriesGrouping>
<StaticSeries>
<StaticMember>
<Label>Value1</Label>
</StaticMember>
</StaticSeries>
</SeriesGrouping>
</SeriesGroupings>
<Top>0.125in</Top>
<PlotArea>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<BackgroundColor>WhiteSmoke</BackgroundColor>
<BackgroundGradientEndColor>White</BackgroundGradientEndColor>
<BackgroundGradientType>TopBottom</BackgroundGradientType>
</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>
<MajorInterval>5</MajorInterval>
<Margin>true</Margin>
<Visible>true</Visible>
<Scalar>true</Scalar>
</Axis>
</ValueAxis>
<Type>Scatter</Type>
<Width>3.5in</Width>
<CategoryGroupings>
<CategoryGrouping>
<DynamicCategories>
<Grouping Name="chart1_CategoryGroup1">
<GroupExpressions>
<GroupExpression>=Fields!MeasurementId.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Sorting>
<SortBy>
<SortExpression>=CDate(Fields!TimeStamp.Value)</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
<Label>=Fields!MeasurementId.Value</Label>
</DynamicCategories>
</CategoryGrouping>
</CategoryGroupings>
<Palette>EarthTones</Palette>
<ChartData>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=CDate(Fields!TimeStamp.Value)</Value>
</DataValue>
<DataValue>
<Value>=Fields!Value.Value</Value>
</DataValue>
</DataValues>
<DataLabel />
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<BorderWidth>
<Default>4.5pt</Default>
</BorderWidth>
</Style>
<Marker>
<Size>6pt</Size>
</Marker>
</DataPoint>
</DataPoints>
</ChartSeries>
</ChartData>
<Style>
<BackgroundColor>White</BackgroundColor>
</Style>
</Chart>
</ReportItems>
<Height>2.25in</Height>
</Body>
<rd:ReportID>a068be44-d5ee-4243-91ed-445f05622d2c</rd:ReportID>
<LeftMargin>1in</LeftMargin>
<DataSets>
<DataSet Name="DataSet1">
<Query>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
<CommandText>select 1 as MeasurementId, '07/16/2006' as TimeStamp, 10 as Value union
select 2 as MeasurementId, '07/17/2006' as TimeStamp, 10 as Value union
select 3 as MeasurementId, '07/17/2006' as TimeStamp, 8 as Value union
select 4 as MeasurementId, '07/18/2006' as TimeStamp, 8 as Value union
select 5 as MeasurementId, '07/19/2006' as TimeStamp, 10 as Value union
select 6 as MeasurementId, '07/19/2006' as TimeStamp, 12 as Value union
select 7 as MeasurementId, '07/20/2006' as TimeStamp, 12 as Value union
select 8 as MeasurementId, '07/21/2006' as TimeStamp, 12 as Value union
select 9 as MeasurementId, '07/21/2006' as TimeStamp, 9 as Value union
select 10 as MeasurementId, '07/22/2006' as TimeStamp, 9 as Value</CommandText>
<DataSourceName>AdventureWorks</DataSourceName>
</Query>
<Fields>
<Field Name="MeasurementId">
<rd:TypeName>System.Int32</rd:TypeName>
<DataField>MeasurementId</DataField>
</Field>
<Field Name="TimeStamp">
<rd:TypeName>System.String</rd:TypeName>
<DataField>TimeStamp</DataField>
</Field>
<Field Name="Value">
<rd:TypeName>System.Int32</rd:TypeName>
<DataField>Value</DataField>
</Field>
</Fields>
</DataSet>
</DataSets>
<Author>Robert M. Bruckner, Microsoft</Author>
<Width>3.75in</Width>
<InteractiveHeight>11in</InteractiveHeight>
<Language>en-US</Language>
<TopMargin>1in</TopMargin>
</Report>

|||

Thanks for posting a reply ill try it first thing in the morning....

The drawing is collected on a handheld, its actually a signature (but it can be a drawing as well, so lots of points....), the coordinates of the drawing are saved in an xml file along with other data, and is then inserted into the database when the device is synced....

ill try the chart way first, and then the custom assembly again. when i tried it last time it was giving me the bitmap not defined error, i dont remember if i was returning the data as an image or as a byte... :) ill give it a try and post back here so that someone else can also make use of your help!

thank you.

|||omg...... thats for the reply and the hints, i doublechecked everything in your 2nd suggestion with what i had already done, the first one wasnt feasible... and after checking all your suggestions i realised that it had been working all this time!!!., it just doesnt work in DEBUG mode... :( when i ran the application itself outside of VS, it ran with no problems!!!!|||Make sure you have copied your assembly to the C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies folder.

Draw Bitmap from Points in report

Hi, i have a database field that has a drawing stored as points, for example....

(x1,y1)(x2,x2)(x1,y1)(x2,x2)(x1,y1)(x2,x2)(x1,y1)(x2,x2)(x1,y1)(x2,x2)(x1,y1)(x2,x2)(x1,y1)(x2,x2)

In my VB.NET application, i can take those points and recreate the image. I need to do the same in reporting services... i am trying to replace a legacy ACCESS report, that had the drawing object.

How can i recreate the image in reporting services? is there an easy way to do so? i believe i tried to create a class and tried to reference it and call the function to return the data as an image, but i got a system.drawing not found error...

There are at least two options:

1. use the built-in charts with chart type = scatter. Note: the scatter chart must have a category grouping based on a unique value (e.g. data point id in your case). I attached a small sample report to the bottom of this posting to show the idea.

2. or draw the image yourself and use it in Reporting Services. However, make sure to follow these steps:

2.1. Design and implement a custom assembly to generate images.
The custom assembly must retrieve the data on its own, take care of grouping/sorting the data, and generating the chart image.
Note: The custom assembly has to return the image as byte[]. It cannot return it as a System.Drawing.Image. You can often convert a System.Drawing.Image object with code similar to the following.
System.IO.MemoryStream renderedImage = new MemoryStream();
myChart.Save(renderedImage);
renderedImage.Position = 0;
return renderedImage.ToArray();

2.2. Add an image to the report.
Set the image type to Database. If the generated image is a bitmap in the PNG image format, set the image mimetype property to “image/png.” For the image value property, use an expression like the following.
=MyCustomAssembly.GenerateChart()

2.3. View the report in Report Designer Preview view to verify that the report is working correctly.
Note: In a default configuration, custom assemblies run in FullTrust in Report Designer preview. Hence, operations that require certain code access security permissions (such as file input/output, data provide access, etc.) are automatically granted these permissions in Fulltrust.

2.4. Deploy the custom assembly on a report server.
Make sure that the security policy configuration of the report server grants sufficient permissions to your custom assembly at runtime; otherwise the image generation will fail. For more information, see Understanding Code Access Security in Reporting Services (http://msdn2.microsoft.com/en-us/library/ms155108.aspx) in SQL Server 2005 Books Online.

-- Robert

=========================================

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<DataSources>
<DataSource Name="AdventureWorks">
<DataSourceReference>AdventureWorks</DataSourceReference>
<rd:DataSourceID>67061ec4-b72e-4a04-a7f3-714536211b9c</rd:DataSourceID>
</DataSource>
</DataSources>
<BottomMargin>1in</BottomMargin>
<RightMargin>1in</RightMargin>
<rd:DrawGrid>true</rd:DrawGrid>
<InteractiveWidth>8.5in</InteractiveWidth>
<rd:SnapToGrid>true</rd:SnapToGrid>
<Body>
<ReportItems>
<Chart Name="chart1">
<Legend>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
<Position>RightCenter</Position>
</Legend>
<Subtype>Line</Subtype>
<Title />
<Height>2in</Height>
<CategoryAxis>
<Axis>
<Title />
<Style>
<Format>MMM dd</Format>
</Style>
<MajorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<Visible>true</Visible>
<Scalar>true</Scalar>
</Axis>
</CategoryAxis>
<PointWidth>0</PointWidth>
<Left>0.125in</Left>
<ThreeDProperties>
<Rotation>30</Rotation>
<Inclination>30</Inclination>
<Shading>Simple</Shading>
<WallThickness>50</WallThickness>
</ThreeDProperties>
<DataSetName>DataSet1</DataSetName>
<SeriesGroupings>
<SeriesGrouping>
<StaticSeries>
<StaticMember>
<Label>Value1</Label>
</StaticMember>
</StaticSeries>
</SeriesGrouping>
</SeriesGroupings>
<Top>0.125in</Top>
<PlotArea>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<BackgroundColor>WhiteSmoke</BackgroundColor>
<BackgroundGradientEndColor>White</BackgroundGradientEndColor>
<BackgroundGradientType>TopBottom</BackgroundGradientType>
</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>
<MajorInterval>5</MajorInterval>
<Margin>true</Margin>
<Visible>true</Visible>
<Scalar>true</Scalar>
</Axis>
</ValueAxis>
<Type>Scatter</Type>
<Width>3.5in</Width>
<CategoryGroupings>
<CategoryGrouping>
<DynamicCategories>
<Grouping Name="chart1_CategoryGroup1">
<GroupExpressions>
<GroupExpression>=Fields!MeasurementId.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Sorting>
<SortBy>
<SortExpression>=CDate(Fields!TimeStamp.Value)</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
<Label>=Fields!MeasurementId.Value</Label>
</DynamicCategories>
</CategoryGrouping>
</CategoryGroupings>
<Palette>EarthTones</Palette>
<ChartData>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=CDate(Fields!TimeStamp.Value)</Value>
</DataValue>
<DataValue>
<Value>=Fields!Value.Value</Value>
</DataValue>
</DataValues>
<DataLabel />
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<BorderWidth>
<Default>4.5pt</Default>
</BorderWidth>
</Style>
<Marker>
<Size>6pt</Size>
</Marker>
</DataPoint>
</DataPoints>
</ChartSeries>
</ChartData>
<Style>
<BackgroundColor>White</BackgroundColor>
</Style>
</Chart>
</ReportItems>
<Height>2.25in</Height>
</Body>
<rd:ReportID>a068be44-d5ee-4243-91ed-445f05622d2c</rd:ReportID>
<LeftMargin>1in</LeftMargin>
<DataSets>
<DataSet Name="DataSet1">
<Query>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
<CommandText>select 1 as MeasurementId, '07/16/2006' as TimeStamp, 10 as Value union
select 2 as MeasurementId, '07/17/2006' as TimeStamp, 10 as Value union
select 3 as MeasurementId, '07/17/2006' as TimeStamp, 8 as Value union
select 4 as MeasurementId, '07/18/2006' as TimeStamp, 8 as Value union
select 5 as MeasurementId, '07/19/2006' as TimeStamp, 10 as Value union
select 6 as MeasurementId, '07/19/2006' as TimeStamp, 12 as Value union
select 7 as MeasurementId, '07/20/2006' as TimeStamp, 12 as Value union
select 8 as MeasurementId, '07/21/2006' as TimeStamp, 12 as Value union
select 9 as MeasurementId, '07/21/2006' as TimeStamp, 9 as Value union
select 10 as MeasurementId, '07/22/2006' as TimeStamp, 9 as Value</CommandText>
<DataSourceName>AdventureWorks</DataSourceName>
</Query>
<Fields>
<Field Name="MeasurementId">
<rd:TypeName>System.Int32</rd:TypeName>
<DataField>MeasurementId</DataField>
</Field>
<Field Name="TimeStamp">
<rd:TypeName>System.String</rd:TypeName>
<DataField>TimeStamp</DataField>
</Field>
<Field Name="Value">
<rd:TypeName>System.Int32</rd:TypeName>
<DataField>Value</DataField>
</Field>
</Fields>
</DataSet>
</DataSets>
<Author>Robert M. Bruckner, Microsoft</Author>
<Width>3.75in</Width>
<InteractiveHeight>11in</InteractiveHeight>
<Language>en-US</Language>
<TopMargin>1in</TopMargin>
</Report>

|||

Thanks for posting a reply ill try it first thing in the morning....

The drawing is collected on a handheld, its actually a signature (but it can be a drawing as well, so lots of points....), the coordinates of the drawing are saved in an xml file along with other data, and is then inserted into the database when the device is synced....

ill try the chart way first, and then the custom assembly again. when i tried it last time it was giving me the bitmap not defined error, i dont remember if i was returning the data as an image or as a byte... :) ill give it a try and post back here so that someone else can also make use of your help!

thank you.

|||omg...... thats for the reply and the hints, i doublechecked everything in your 2nd suggestion with what i had already done, the first one wasnt feasible... and after checking all your suggestions i realised that it had been working all this time!!!., it just doesnt work in DEBUG mode... :( when i ran the application itself outside of VS, it ran with no problems!!!!|||Make sure you have copied your assembly to the C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies folder.

Draw Axis on Barchart

Hi,

I have a little problem with my barchart.
The chart shows negative and positive values and i want a simple vertical black line at 0.
But I havent found any solutions for this problem yet that satisfies me.

What I tried:
- Draw a normal line and place it above the graph -> doesnt work in all renderers
(Overlapping Reportitems are not supported ....)

-with the parameter "Cross At"
i have labels on the axis and if i "cross at" 0, the labels also move into the middle and overlap
with the bars/point labels

- with Gridlines (so far the best solution)
Chart with a fixed range (for example -100 to +100) and set the gridline interval to 100
this prints 3 Gridlines, 1st at -100, 2nd at 0 (what I want) and a 3rd at +100 - that would be ok for me
BUT i need a variable chart range!
so if the chart range goes from -100 to +200, i have a gridline at +100 crossing all bars !!

here are some pictures of my problem

what i want:
http://www.hmayer.net/show_image.php?id=4387&scaled&scalesize=800&nocount=y

what i got:
http://www.hmayer.net/show_image.php?id=4386&scaled&scalesize=800&nocount=y

any other ideas?

thanks,
GerhardYou can accomplish this with the following expression, if you are willing to have the min and max for the axis be the same absolute value. The expression calculates the largest value, in absolute terms, and sets the min(with negation), max and major interval properties on the Y-axis to this expression.

Min:

=-Math.Max(Max(Fields!FieldName.Value), Math.Abs(Min(Fields!FieldName.Value)))

Max:
=Math.Max(Max(Fields!FieldName.Value), Math.Abs(Min(Fields!FieldName.Value)))

Major Interval:
=Math.Max(Max(Fields!FieldName.Value), Math.Abs(Min(Fields!FieldName.Value)))

Note: Expressions for these properties are not su supported in RS 2000

Another approach would be to set the Cross At to 0 and not use tick marks or axis labels on the axis. Instead of using the labels, you could use a table placed beside the chart that contains these values. It may be tricky to get the labels line up correctly--make sure to sort the category group and the table the same way.

Ian