Showing posts with label configured. Show all posts
Showing posts with label configured. Show all posts

Monday, March 19, 2012

Custom Renderer in SharePoint integrated mode

We have been successful in creating a custom Excel Renderer that works very well on a server configured for SSRS Native mode. However we have another server that is configured to work in SSRS integrated mode that we can not get this custom renderer to work properly. The steps we follow are:

After the report results are displayed we select Actions -> Export -> Excel Custom . So I can see the name of our custom rendering type. After a very short amount of time (no more than a second or 2) I get a frame that says: an unexpected error has occurred. Here is the URL of the web site:

http://sharepointserver/sites/BI/Reports/Reserved.ReportViewerWebPart.axd?ReportSession=2jqe4e45sm0sze553avovv55&ControlID=5c4fbb59def64efdac050393cd3fb338&Culture=1033&UICulture=1033&ReportStack=1&OpType=Export&FileName=edi001&ContentDisposition=OnlyHtmlInline&Format=CUSTOM_RENDERER

Is there anything that has to be done differently to get a custom renderer to work in SharePoint integrated mode?

Note: here is the article we followed to initially create the renderer that will work in SSRS native mode:

http://msdn.microsoft.com/msdnmag/issues/05/02/CustomRenderers/

Any help would be appreciated, thanks.

I have had the same problem, and have not found any hints yet on how to get a custom renderer to work. I check the supported/unsupported feature list for Integrated SSRS, and there is no mention there that the feature is not available, so am holding out hope that it is something simple.

-cg

Saturday, February 25, 2012

Custom Data Extensions and Custom Code: do they require any special settings for internet?

I have configured the config files so that my custom code and data extension
work fine internally. I am having problems getting them to work over the
internet.
Are there any special considerations for this?
ThanksWhat kind of problems?
What do you mean by "work over the internet"?
--
Alex Mineev
Software Design Engineer. Report expressions; Code Access Security; Xml;
SQE.
This posting is provided "AS IS" with no warranties, and confers no rights
"Kevin" <k@.r.com> wrote in message
news:uCmWs0kCFHA.2632@.TK2MSFTNGP09.phx.gbl...
> I have configured the config files so that my custom code and data
extension
> work fine internally. I am having problems getting them to work over the
> internet.
> Are there any special considerations for this?
> Thanks
>|||I have solved the issue. Code Access had to be set for the custom dll.
Thanks
"Alexandre Mineev [MSFT]" <almineev@.microsoft.com> wrote in message
news:eXrtP9tDFHA.392@.TK2MSFTNGP14.phx.gbl...
> What kind of problems?
> What do you mean by "work over the internet"?
> --
> Alex Mineev
> Software Design Engineer. Report expressions; Code Access Security; Xml;
> SQE.
> This posting is provided "AS IS" with no warranties, and confers no rights
> "Kevin" <k@.r.com> wrote in message
> news:uCmWs0kCFHA.2632@.TK2MSFTNGP09.phx.gbl...
>> I have configured the config files so that my custom code and data
> extension
>> work fine internally. I am having problems getting them to work over the
>> internet.
>> Are there any special considerations for this?
>> Thanks
>>
>

Custom ControlFlow

I am trying to design a Component which can be configured by a UI. After Configuration from the Design pane the Data should be passed to the back-end of the Component.
When I look at some code samples I only see, that it's possible to pass simple data.
What I want is to put a grid on the UI and connect it to a DataTable. This is used for displaying and changing a configuration as a table.
Well, the question is: Can I pass the DataTable object to the backend-DLL as is? If so then how?
THX
Fridtjof
Can you please clarify whether you are creating a custom Task or a custom Data Flow Component, or another type of run-time object like a connection manager? The APIs are similar but not identical.

-Doug
|||From your subect I assume you mean a Task. Why can you not just create a property of your task, typed as a DataTable?|||Well I don't have any instance of the Backend Class in the Definition of the UI-Class, have I?
If I had one there would be no problem setting the DataSource of the Grid to that DataTable.
|||

You keep referring to the backend-class, do you mean the task itself, the class that inherits from Task?

If so you should have a reference to it in the UI. You need to cache it and pass it through, but otherwise there is not much point to the UI.

Review this code form one of my tasks. This is the UI class, the one that inherits from IDtsTaskUI. My form is ZipFileTaskUIForm, and has a modified constructor to accept the parameters passed through. You can see the TaskHost is cached in Initialize, and then passed to the form. This is how you get a reference to your task into the form.


public System.Windows.Forms.ContainerControl GetView()
{
return new ZipFileTaskUIForm(_taskHost, _dtsConnectionService, _dtsVariableService);
}
public void Initialize(TaskHost taskHost, IServiceProvider serviceProvider)
{
_taskHost = taskHost;

IDtsVariableService dtsVariableService = serviceProvider.GetService(typeof(IDtsVariableService)) as IDtsVariableService;
IDtsConnectionService dtsConnectionService = serviceProvider.GetService(typeof(IDtsConnectionService)) as IDtsConnectionService;
_dtsConnectionService = dtsConnectionService;
_dtsVariableService = dtsVariableService;
}


|||To your question: Yes I mean the class which inherits from Task! That's what I call Backend-Class.
Your code is from the Class which inherits from IDtsTaskUI.
The question is how can you access public members of my Backend-Class in the UI (Form).
Maybe I have to convert and cache then, because the ui is called at design-time and the Backend at runtime?
|||Your form should be invoked from the UI class (IDtsTaskUI). The sample I showed demonstrates grabbing TaskHost, and passing it through to the form. You use the TaskHost to access properies of the task itself. You cannot get direct access to the Task instance, but you should not actually need to as you have TaskHost instead.
If you have code that you wish to share between trasjk and UI classes, then make them public static. Instance members would not work anyway since you cannot get the instance.

|||In addition to the Initialize method in the UI class that comes from the IDtsXxxUI interface, I would be inclined to write an Initialize method of my own in my Windows Forms class and pass along a reference to my task or other object, so I can easily read its current property values to set initial control states and values, then update its properties from the controls when the user closes the form.

So Task passes reference to itself in calling Initialize in Task UI class, and Task UI class passes reference to task in calling custom Initialize method in Task UI Form class.

-Doug
|||

I am also facing same problem. When i explored i came to know that there was two method SaveToXML() and LoadXML() of IDTSPersist90 interface to handle this type of scenerio. But i could not able to raise these methods. you can transfer either string or interger...etc, but if you want to transfer some custom object i think you have to preserve the same in xml and retrieve it when ever needed

...Karun

|||

As I understand the issue, bearing in mind this thread crossed several, none of which matched the title that well, but you are writing a task and have a complex type that you need to persist. All persistance is through XML, and for complex stuff you need to implement IDTSPersist90 yourself. The methods are never called by you, they are called by the designer. You fill in the code to save and load the values to and from the XML document provided, and you can choose how you store the information in the XML.

For objects, I found the easiest way to to serialize them, and actually binary serialization at that. This snippet gives me a string that I can easily store in an xml element for the property.

public static string SerializeObject(object graph) { BinaryFormatter formatter1 = new BinaryFormatter(); MemoryStream stream1 = new MemoryStream(); formatter1.Serialize(stream1, graph); string text1 = Convert.ToBase64String(stream1.GetBuffer()); stream1.Close(); return text1; }

Another alternative is to use reflection to read an object's properties, and then build up an XML node that represents this. Here is an example of creating a new element with sub elements for each property-

public static XmlElement AddXmlObjectProperties(XmlElement parentElement, string propertyName, object propertyObject) { XmlElement element1 = XMLPersistanceHelper.AddXmlElement(parentElement, propertyName); Type type1 = propertyObject.GetType(); foreach (PropertyInfo info1 in type1.GetProperties()) { Type type2 = info1.PropertyType; string text1 = type2.Name; object obj1 = info1.GetValue(propertyObject, null); if (type2.IsEnum) { obj1 = Convert.ToInt32(info1.GetValue(propertyObject, null)); } if (obj1 != null) { XmlElement element2 = XMLPersistanceHelper.AddXmlElement(element1, "Property", obj1.ToString()); XMLPersistanceHelper.AddXmlAttribute(element2, "Name", info1.Name); XMLPersistanceHelper.AddXmlAttribute(element2, "Type", text1); } } return element1; }

Custom ControlFlow

I am trying to design a Component which can be configured by a UI. After Configuration from the Design pane the Data should be passed to the back-end of the Component.
When I look at some code samples I only see, that it's possible to pass simple data.
What I want is to put a grid on the UI and connect it to a DataTable. This is used for displaying and changing a configuration as a table.
Well, the question is: Can I pass the DataTable object to the backend-DLL as is? If so then how?
THX
Fridtjof
Can you please clarify whether you are creating a custom Task or a custom Data Flow Component, or another type of run-time object like a connection manager? The APIs are similar but not identical.

-Doug
|||From your subect I assume you mean a Task. Why can you not just create a property of your task, typed as a DataTable?|||Well I don't have any instance of the Backend Class in the Definition of the UI-Class, have I?
If I had one there would be no problem setting the DataSource of the Grid to that DataTable.
|||

You keep referring to the backend-class, do you mean the task itself, the class that inherits from Task?

If so you should have a reference to it in the UI. You need to cache it and pass it through, but otherwise there is not much point to the UI.

Review this code form one of my tasks. This is the UI class, the one that inherits from IDtsTaskUI. My form is ZipFileTaskUIForm, and has a modified constructor to accept the parameters passed through. You can see the TaskHost is cached in Initialize, and then passed to the form. This is how you get a reference to your task into the form.


public System.Windows.Forms.ContainerControl GetView()
{
return new ZipFileTaskUIForm(_taskHost, _dtsConnectionService, _dtsVariableService);
}
public void Initialize(TaskHost taskHost, IServiceProvider serviceProvider)
{
_taskHost = taskHost;

IDtsVariableService dtsVariableService = serviceProvider.GetService(typeof(IDtsVariableService)) as IDtsVariableService;
IDtsConnectionService dtsConnectionService = serviceProvider.GetService(typeof(IDtsConnectionService)) as IDtsConnectionService;
_dtsConnectionService = dtsConnectionService;
_dtsVariableService = dtsVariableService;
}


|||To your question: Yes I mean the class which inherits from Task! That's what I call Backend-Class.
Your code is from the Class which inherits from IDtsTaskUI.
The question is how can you access public members of my Backend-Class in the UI (Form).
Maybe I have to convert and cache then, because the ui is called at design-time and the Backend at runtime?
|||Your form should be invoked from the UI class (IDtsTaskUI). The sample I showed demonstrates grabbing TaskHost, and passing it through to the form. You use the TaskHost to access properies of the task itself. You cannot get direct access to the Task instance, but you should not actually need to as you have TaskHost instead.
If you have code that you wish to share between trasjk and UI classes, then make them public static. Instance members would not work anyway since you cannot get the instance.

|||In addition to the Initialize method in the UI class that comes from the IDtsXxxUI interface, I would be inclined to write an Initialize method of my own in my Windows Forms class and pass along a reference to my task or other object, so I can easily read its current property values to set initial control states and values, then update its properties from the controls when the user closes the form.

So Task passes reference to itself in calling Initialize in Task UI class, and Task UI class passes reference to task in calling custom Initialize method in Task UI Form class.

-Doug
|||

I am also facing same problem. When i explored i came to know that there was two method SaveToXML() and LoadXML() of IDTSPersist90 interface to handle this type of scenerio. But i could not able to raise these methods. you can transfer either string or interger...etc, but if you want to transfer some custom object i think you have to preserve the same in xml and retrieve it when ever needed

...Karun

|||

As I understand the issue, bearing in mind this thread crossed several, none of which matched the title that well, but you are writing a task and have a complex type that you need to persist. All persistance is through XML, and for complex stuff you need to implement IDTSPersist90 yourself. The methods are never called by you, they are called by the designer. You fill in the code to save and load the values to and from the XML document provided, and you can choose how you store the information in the XML.

For objects, I found the easiest way to to serialize them, and actually binary serialization at that. This snippet gives me a string that I can easily store in an xml element for the property.

public static string SerializeObject(object graph) { BinaryFormatter formatter1 = new BinaryFormatter(); MemoryStream stream1 = new MemoryStream(); formatter1.Serialize(stream1, graph); string text1 = Convert.ToBase64String(stream1.GetBuffer()); stream1.Close(); return text1; }

Another alternative is to use reflection to read an object's properties, and then build up an XML node that represents this. Here is an example of creating a new element with sub elements for each property-

public static XmlElement AddXmlObjectProperties(XmlElement parentElement, string propertyName, object propertyObject) { XmlElement element1 = XMLPersistanceHelper.AddXmlElement(parentElement, propertyName); Type type1 = propertyObject.GetType(); foreach (PropertyInfo info1 in type1.GetProperties()) { Type type2 = info1.PropertyType; string text1 = type2.Name; object obj1 = info1.GetValue(propertyObject, null); if (type2.IsEnum) { obj1 = Convert.ToInt32(info1.GetValue(propertyObject, null)); } if (obj1 != null) { XmlElement element2 = XMLPersistanceHelper.AddXmlElement(element1, "Property", obj1.ToString()); XMLPersistanceHelper.AddXmlAttribute(element2, "Name", info1.Name); XMLPersistanceHelper.AddXmlAttribute(element2, "Type", text1); } } return element1; }

Sunday, February 19, 2012

Custom Assembly Problems: System.Drawing

Hi,
I built a Custom Assembly to allow me to use external image files in
my report. I deployed the DLL and configured the security policy
config files.
Everything worked great, i got the image coming through to my report
in both Designer Preview mode and when deployed.
I decided to extend the custom assembly to return the dimensions of
the image as well by adding some code that utilizes System.Drawing.DLL
//ok now, lets get the width and height
//FileIOPermission permission = new FileIOPermission
Image myImage = Image.FromFile(pPath);
g_lastHeight = myImage.Height;
g_lastWidth = myImage.Width;
myImage.Dispose();
myImage=null;
After rebuilding and deploying the DLL, my report no longer has any
images when deployed.
However, the images do show up in Designer preview mode, and the DLL
performs correctly returning the image dimensions upon request,
implying a security policy issue'
So my question is what security policy type things do i need to do in
order to utilize System.Drawing.dll in my DLL.
Any help would be greatly appreciated.
Thanks
DerekI believe the correct permission is UIPermission. Please see the following for why it only works in
preview and how to configure the server:
http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/dngrfCodeAccessSecurityInSQLServer2000ReportingServices.asp?frame=true
Thanks.
Donovan R. Smith
Software Test Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
"Derek W" <derek@.brokerbuilders.com> wrote in message
news:a5df538d.0408161409.6d219516@.posting.google.com...
> Hi,
> I built a Custom Assembly to allow me to use external image files in
> my report. I deployed the DLL and configured the security policy
> config files.
> Everything worked great, i got the image coming through to my report
> in both Designer Preview mode and when deployed.
> I decided to extend the custom assembly to return the dimensions of
> the image as well by adding some code that utilizes System.Drawing.DLL
> //ok now, lets get the width and height
> //FileIOPermission permission = new FileIOPermission
> Image myImage = Image.FromFile(pPath);
> g_lastHeight = myImage.Height;
> g_lastWidth = myImage.Width;
> myImage.Dispose();
> myImage=null;
> After rebuilding and deploying the DLL, my report no longer has any
> images when deployed.
> However, the images do show up in Designer preview mode, and the DLL
> performs correctly returning the image dimensions upon request,
> implying a security policy issue'
> So my question is what security policy type things do i need to do in
> order to utilize System.Drawing.dll in my DLL.
> Any help would be greatly appreciated.
> Thanks
> Derek