Skip to Content
author's profile photo Former Member
Former Member

How can i create add on Embedded my report with?

Hi all,

I have created add on file for sap.In my add on project,i have many reports.

i want to open my report all time i use my add on.

When i click button show report,the system display error message like this "Invalid Directory".

I think that it's error because of my report.


Note.

here is my code for access to my report folder:

application.startup & "\Sales\report1.rpt

Does anyone know how i can solve this problem?

Thanks

TONY

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 03, 2012 at 01:53 AM

    Please post the whole code how you retrieve your reports.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Bryan Gomez

      here is my code for load report

      Private Sub cmdOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOk.Click

      If CheckBox1.Checked = True Then

      RName = Application.StartupPath & "\ReportKH\"

      Else

      RName = Application.StartupPath & "\ReportEN\"

      End If

      NF = SAPActivity.ReportClick

      If NF = 0 Then

      Exit Sub

      Else

      Select Case NF

      Case 1

      RName = RName & "CollectProfit By Year.rpt"

      Case 2

      RName = RName & "Budget By Year.rpt"

      case 3

      RName = RName & "JE_Dr_Cr_By_Month_Year_Summary.rpt"

      Case 4

      RName = RName & "JE_Dr_Cr_By_Month_Year_Detail.rpt"

      End Select

      Dim othr As ThreadStart, myThread As Thread

      othr = New ThreadStart(AddressOf LoadReport)

      myThread = New Thread(othr)

      myThread.SetApartmentState(ApartmentState.STA)

      myThread.Start()

      end sub

      Private Sub LoadReport()

      Try

      Select Case opt

      Case 1

      PrintUnicode(frmPreview.AxCrystalActiveXReportViewer1, _

      RName, Me.tyear.Text)

      Case 2

      PrintUnicode(frmPreview.AxCrystalActiveXReportViewer1, _

      RName, Me.tmonth.Text, Me.tyear.Text)

      Case 3

      PrintUnicode(frmPreview.AxCrystalActiveXReportViewer1, _

      RName, "", Me.tmonth.Text, Me.tyear.Text)

      End Select

      Catch ex As Exception

      MsgBox(ex.Message)

      End Try

      End Sub

      So when i click on Ok Button, the report path will get

      RName = Application.StartupPath & "\ReportKH\"

      And for build the Add On,I don't know to get that path.

      Thanks

      TONY

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.