How to set string variable in PPT

Hi,

I am using Visual Studio 2005 I have a table which represent dynamic reports and now my client’s requirement is convert report in PPT. Now I am able to create simple PPT. but I don’t know how to set the variable’s values in Presentation Slide?

Please give me solutions or send me code or code link that how to pass string variable or multidimensional array in Slide. It is urgent for me please reply me ASAP. I am waiting for your reply

Thanks,
Irfan Lateef

Hello,

Are you using?

1- Aspose.Slides for .NET
Or
2- Aspose.Slides for Reporting Services

In case of first one, please see Programmer’s Guide and also see the demo namely Template that can be found inside the installation directory of Aspose.Slides for .NET

Aspose.Slides\Demos\C#\Template

Hello,


I am using Aspose.Slide for .NET

Now I am able to create PPT on the runtime, I have one question I am using VB.NET, in my aspx.vb page have 1 div and 1 table I have create div and table on the runtime from code behind… Div and table showing report can i show embade div or table from PPT?

Thanks,
Irfan Lateef

Hello,

If your report is inside the .PPT file and you want to display it on your web page, then you should consider getting the thumbnail image of your ppt slides and display them on your web page as images.

Creating Slide Thumbnail Image

Also, see if Working with Tables can help you solve your problem.

Hello Faiz,


You didn’t unserstand my problem, Problem is that My Webpage showing me single table and table contains data, I have function which can convert into Excel all the data, but now my client’s requirment convert all table into Powerpoint. now please tell me the way how to convert table into Powerpoint (PPT).

Thanks,

Irfan Lateef

Hello,

There is no direct way that could take your html table as input and convert it automatically to powerpoint table.

Therefore you will have to create a table in your ppt file that should match with the table displayed in your web page.

Please see Working with Tables

Also, see an example of How to create a Formatted Table using Aspose.Slides?

Hello Shakeel Faiz,

Thanks for the quick reply

Now I can create table in .ppt and it is working fine but I need still your help.

I write a code,

Dim pres As Presentation = New Presentation("C:\\demo.ppt")
Dim slide As Slide = pres.GetSlideByPosition(1)

Dim xPosition As Integer = 880
Dim yPosition As Integer = 600
Dim tableWidth As Integer = 4000
Dim tableHeight As Integer = 500

Dim columns As Integer = 4
Dim rows As Integer = 4
Dim borderWidth As Double = 2
Dim objDB As New DB

Dim ds As DataSet = objDB.ReturnDataSet("select * from Jobs")
columns = Convert.ToInt32(ds.Tables(0).Columns.Count)
rows = Convert.ToInt32(ds.Tables(0).Rows.Count)

Dim table As Table = slide.Shapes.AddTable(xPosition, yPosition, tableWidth, tableHeight, columns, rows, borderWidth, Color.Blue)

If ds.Tables(0).Rows.Count > 0 Then
    For r As Integer = 0 To ds.Tables(0).Rows.Count - 1
        For c As Integer = 0 To ds.Tables(0).Columns.Count - 1
            Dim tf As Aspose.Slides.TextFrame = table.GetCell(c, r).TextFrame
            If tf IsNot Nothing Then
                tf.Paragraphs(0).Portions(0).Text = ds.Tables(0).Rows(r)("JobDesc").ToString()
            End If
        Next
    Next
End If

pres.Write("C:\\report.ppt")

Note:

Point # 1: The problem is I have more than 20 columns and more than 20 rows but it is not adjust on the signle slide, how to split slide when slide is full? I mean data is large it cannot adjust on single slide, I want when slide have no space then spare data rows and columns set next slide.

Point # 2: How to remove “Evaluation only. Created with Aspose.PowerPoint. Copyright 2004 Aspose Pty Ltd.” This backgraound text?

Thanks,
Irfan Lateef

Hello,

1- You need to check if table.height exceeds the presentation.SlideSize.Height property, if that is the case, you should move to next slide or create a new slide and then create a new table in it and populate it with the rest of the data.

2- The watermark is the limitation of evaluation version of Aspose.Slides. To remove it you need to purchase Aspose.Slides license.

Hello Shakeel Faiz,

Please give me example: How to add new table and how to set rest of data in new table?

I purchased total Aspose control’s license so Aspose.Slides include in license… am I using free product that’s why “Evaluation only. Created with Aspose.PowerPoint. Copyright 2004 Aspose Pty Ltd.” text appears in my slides? If I am using free product then please tell me how to use license software, I just added reference Aspose.Slide.dll in my Visual studio .net, I downloaded Aspose.slide setup and I installed in my system.

Please give me example how to add new table and set the rest of data in new powerpoint slide?

Thanks,
Irfan Lateef