Saturday, February 25, 2012
Charts
don’t have the aggregate you need, you can create a custom field (name
it whatever you want) and wrap the base field in the SUM() aggregate
function, which should be a no-op in this case.Hi Bob,
Thanks a bunch! That did work!
Charts
troubles getting my chart object (and tried to return and image) to render
within my reports. I'm confident I have the custom assemblie referenced. I
don't want to use the chart field from the toolbox, I want to set it to what
my assemblie returns. Anyway to get around this? I'm aware of the custom
data extensions, although, I wanted to just have my existing assemblie which
returns charts do it instead. so all my reports that need graphs can just
reference the assemblie and graph that is needed. Anyway to accomplish this?
I'm getting data type reference errors etc.
ClintPlease try this:
* Add an image to your report
* Set the image type to Database
* Set the image mimetype to e.g. image/png
* For the image value use an expression like
=MyCustomAssembly.GenerateChart()
Note: your custom assembly call has to return the image as byte[].
Here is a code snippet which should convert the Dundas chart output into a
byte array:
public static byte[] GenerateChart()
{
// chart rendering code
...
// save chart image to byte[]
System.IO.MemoryStream renderedImage = new MemoryStream();
dundasChart.ImageType = ChartImageType.Png;
dundasChart.Save(renderedImage);
renderedImage.Position = 0;
return renderedImage.ToArray();
}
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Clint Jennings" <cjennings@.fusionAlliance.com> wrote in message
news:%237PwafckEHA.896@.TK2MSFTNGP12.phx.gbl...
> I have a Custom Dundas Charting library that I utilize normally. I'm
having
> troubles getting my chart object (and tried to return and image) to render
> within my reports. I'm confident I have the custom assemblie referenced.
I
> don't want to use the chart field from the toolbox, I want to set it to
what
> my assemblie returns. Anyway to get around this? I'm aware of the custom
> data extensions, although, I wanted to just have my existing assemblie
which
> returns charts do it instead. so all my reports that need graphs can just
> reference the assemblie and graph that is needed. Anyway to accomplish
this?
> I'm getting data type reference errors etc.
> Clint
>|||Thanks Robert. Created a public function in the library to return a byte
stream.
"Robert Bruckner [MSFT]" wrote:
> Please try this:
> * Add an image to your report
> * Set the image type to Database
> * Set the image mimetype to e.g. image/png
> * For the image value use an expression like
> =MyCustomAssembly.GenerateChart()
> Note: your custom assembly call has to return the image as byte[].
> Here is a code snippet which should convert the Dundas chart output into a
> byte array:
> public static byte[] GenerateChart()
> {
> // chart rendering code
> ...
> // save chart image to byte[]
> System.IO.MemoryStream renderedImage = new MemoryStream();
> dundasChart.ImageType = ChartImageType.Png;
> dundasChart.Save(renderedImage);
> renderedImage.Position = 0;
> return renderedImage.ToArray();
> }
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Clint Jennings" <cjennings@.fusionAlliance.com> wrote in message
> news:%237PwafckEHA.896@.TK2MSFTNGP12.phx.gbl...
> > I have a Custom Dundas Charting library that I utilize normally. I'm
> having
> > troubles getting my chart object (and tried to return and image) to render
> > within my reports. I'm confident I have the custom assemblie referenced.
> I
> > don't want to use the chart field from the toolbox, I want to set it to
> what
> > my assemblie returns. Anyway to get around this? I'm aware of the custom
> > data extensions, although, I wanted to just have my existing assemblie
> which
> > returns charts do it instead. so all my reports that need graphs can just
> > reference the assemblie and graph that is needed. Anyway to accomplish
> this?
> > I'm getting data type reference errors etc.
> >
> > Clint
> >
> >
>
>
Sunday, February 19, 2012
Chart data from custom assembly method?
I'm new to reporting services and have a question for you.
I've managed to get a single value from a custom assembly method and publish
it on a report,
what I want to do now is to fill a chart with data from my custom assembly
method, the data
is returned like a dataset.
Displaying a single value was no big deal, found a lot of examples on the
net and in this forum, but
setting the custom dataset as source is very hard to find.
Regards,
Peter Larsson!Isn't this possible, anyone?
/P
"Peter Larsson" <peterskola@.frillesas.nospam> wrote in message
news:eAHDhuahHHA.1624@.TK2MSFTNGP06.phx.gbl...
> Hi!
> I'm new to reporting services and have a question for you.
> I've managed to get a single value from a custom assembly method and
> publish it on a report,
> what I want to do now is to fill a chart with data from my custom assembly
> method, the data
> is returned like a dataset.
> Displaying a single value was no big deal, found a lot of examples on the
> net and in this forum, but
> setting the custom dataset as source is very hard to find.
> Regards,
> Peter Larsson!
>
>
Chart Custom Series Color Problem
one, but when we change the bar color of
the first group, all the groups suddenly become the color we set. This works
fine if we change the background for any other group (not the first group).
Is there any way to get around this?
Example:
This makes all of the columns for all of the groups Orange (#FF9933)
=IIF( First(Fields!NUM.Value, "chart1_CategoryGroup1") = "1",
"#FF9933","Transparent")
This works as expected - except it is on the second group.
=IIF( First(Fields!NUM.Value, "chart1_CategoryGroup1") = "2",
"#FF9933","Transparent")
The data that we want to have custom colored has to be the first set.I'm not sure I understand the issue correctly - but the aggregate scope in
the expression seems incorrect. Instead of scoping with the category
grouping, you should scope with the series grouping (assuming there is a
series grouping in the chart).
E.g.:
=IIF( First(Fields!NUM.Value, "chart1_SeriesGroup1") = "2",
"#FF9933","Transparent")
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"debra doty" <debradoty@.discussions.microsoft.com> wrote in message
news:27C5AC1A-8AAC-41A6-BF0B-29FC932AC720@.microsoft.com...
> We want to use the default palette for all series groups except the first
> one, but when we change the bar color of
> the first group, all the groups suddenly become the color we set. This
works
> fine if we change the background for any other group (not the first
group).
> Is there any way to get around this?
> Example:
> This makes all of the columns for all of the groups Orange (#FF9933)
> =IIF( First(Fields!NUM.Value, "chart1_CategoryGroup1") = "1",
> "#FF9933","Transparent")
> This works as expected - except it is on the second group.
> =IIF( First(Fields!NUM.Value, "chart1_CategoryGroup1") = "2",
> "#FF9933","Transparent")
> The data that we want to have custom colored has to be the first set.
>|||Sorry, I copy/pasted my last desperate attempt at getting this to work.
We did use the series grouping scope, it didn't make any difference. In one
report, we group the data by the day of week. The week starts on Sun. We
want all columns in the Sun group to have a backgroud of orange and the rest
of the week to use the default palette. If we make Tues orange this works
fine - but because Sun is the first group, all the columns in all the groups
become orange.
"Robert Bruckner [MSFT]" wrote:
> I'm not sure I understand the issue correctly - but the aggregate scope in
> the expression seems incorrect. Instead of scoping with the category
> grouping, you should scope with the series grouping (assuming there is a
> series grouping in the chart).
> E.g.:
> =IIF( First(Fields!NUM.Value, "chart1_SeriesGroup1") = "2",
> "#FF9933","Transparent")
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "debra doty" <debradoty@.discussions.microsoft.com> wrote in message
> news:27C5AC1A-8AAC-41A6-BF0B-29FC932AC720@.microsoft.com...
> > We want to use the default palette for all series groups except the first
> > one, but when we change the bar color of
> > the first group, all the groups suddenly become the color we set. This
> works
> > fine if we change the background for any other group (not the first
> group).
> > Is there any way to get around this?
> >
> > Example:
> > This makes all of the columns for all of the groups Orange (#FF9933)
> > =IIF( First(Fields!NUM.Value, "chart1_CategoryGroup1") = "1",
> > "#FF9933","Transparent")
> >
> > This works as expected - except it is on the second group.
> > =IIF( First(Fields!NUM.Value, "chart1_CategoryGroup1") = "2",
> > "#FF9933","Transparent")
> >
> > The data that we want to have custom colored has to be the first set.
> >
>
>
Tuesday, February 14, 2012
Character is not valid
Hi,
I do not know what I did wrong. I tested a simple function in my custom code and get the error saying "Character is not valid". Any help is appreciated!
Here is the function inside my custom code.
Shared Function test() As string
Dim items As Fields
Return items("DataField1").Value;
End Function
I call the function in the body of my report using: Code.test()
and the error says "There is an error on line 18 of custom code: [BC30037] Character is not valid."
Thanks,
Tabbey
Try to remove " ; " after Return items("DataField1").Value|||Also, you cannot refer to dataset items inside of your Report code block. You must pass values into your function.
Something like this:
Shared Function test(fieldvalue as string) As string
test = fieldvalue
End Function
And then call the function in the body of the report:
=Code.test(ReportItems!DatasetField.Value)
|||I need to build "fields string" in my custom code depending on the parameters users selected.
If I cannot refer to the dataset items inside the custom code, can you think of any other alternative solution?
I construct the fields string in textbox expression, but I get an error if the field did not exist since IIF evaluate the entire expression.
Thanks,
Tabbey
|||Can you create a function with a signature that accepts all the fields you wish to concatenate?Function addString (field1 as string, field2 as string, field3 as string) as String
if Parameter!UserInput.Value = true then
addString = field1 & field2 & field3
End Function
You could always create a custom data processing extension and handle it there. you could also probably handle this in the logic of your stored procedure.|||
Andy,
That sounds like a good idea. Let me try that out. Thanks!