Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello. I want to export a report u

Status
Not open for further replies.

rafapj

Programmer
Sep 2, 2003
5
ES
Hello.
I want to export a report using the webapi functions in Visual Basic.
I have tried to use the function IDSSXMLReportServer:: Report but it does not work well. Someone has a code of example of this function?
It will be helpful know to reference the dll library which contains de MSTRWebApiException.
Thanks
 
i would check out the code in export.asp in the web product.
 
This is the code:

Public Function ObtenerFicheroInforme(ByVal psIdSesion As String, ByVal
psIdUsuario As String, _
ByVal psServicio
As String, ByVal psIdProyecto As String, _
ByVal psIdInforme
As String, ByVal pyFormato As Byte) As String


'Variables SDK Microstrategy
Dim loSesionServidor As New MSIXMLLib.DSSXMLServerSessionClass()
Dim loServidorMS As MSIXMLLib.IDSSXMLObjectServer
Dim loReportMS As MSIXMLLib.IDSSXMLReportServer

Dim loProyectoSesion As ProyectoSesion

Dim lsStrXMLResults As String = Nothing

Dim loPrueba As MSIXMLLib.IDSSXMLReportServer3

Try

loSesionServidor.ServerName = Servidor()
loSesionServidor.Port = Puerto()
loServidorMS = loSesionServidor.ObjectServer
loPrueba = loSesionServidor.ReportServer

If pyFormato = 0 Then
'XLS

Try
Dim exportparametro As String = &quot;<ept daf=&quot;&quot;T&quot;&quot; sep=&quot;&quot;,&quot;&quot; />&quot;
Dim loTemp As Object
Dim Objeto As Object

lsStrXMLResults = loPrueba.Export(psIdSession, psIdInforme, EnumDSSXMLExportFormat.DssXmlExportExcel, exportparametro, -1, Objeto)


Catch loException As Exception
Dim err As String
err = loException.ToString

End Try
End If

Catch

End Try
Return lsStrXMLResults
End Function

---------------------------------------------
The ultimate goal of this is to export a report in Excel Format.
Where is wroten Object as parameter of the export function, we must pass an Object like the IntWrapper Java.
There is any Object in VB .Net that simulates the same function that IntWrapper?
Where we could find info about export report to Excel Format?


Thanks.
 
yeah, leverage the existing code in Export.asp and ExportCuLib.asp....why reinvent the wheel? You can even use those pages directly if you give them the right params...in fact just append the following to a URL string and it should be enough...here's what you do in an ASP:

[green]
sURL = &quot;ReportID=&quot; & aReportInfo(S_REPORT_ID_REPORT)
sURL = sURL & &quot;&MsgID=&quot; & aReportInfo(S_MSG_ID_REPORT)
sURL = sURL & &quot;&XSL=TABLE&quot;
sURL = sURL & &quot;&sr=1&quot;
sURL = sURL & &quot;&sc=1&quot;
sURL = sURL & &quot;&style=&quot; & aReportInfo(S_CURR_CSS_REPORT)
sURL = sURL & &quot;&mc=&quot; & aReportInfo(N_MAX_COLS_REPORT)
sURL = sURL & &quot;&mr=&quot; & aReportInfo(N_MAX_ROWS_REPORT)
sURL = sURL & &quot;&tc=&quot; & aReportInfo(N_TOTAL_COLS_REPORT)
sURL = sURL & &quot;&so=True&quot;
sURL = sURL & &quot;&view=Grid&quot;
sURL = &quot;export.asp?&quot; & sURL

response.redirect sURL

[/green]
 
The problem is that I want to do a webservice and we don't want to call the microstrategy web pages. We want to do a Webservice that gets a report in plain text and then return it in other formats like excel,pdf,etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top