IShape.SetHyperlink does not support indexes to link slide

IShape.SetHyperlink does not support indexes to link the specific slide by index but as per documentation it can be set by indexes. 
I believe there is some issue in IShape.SetHyperlink method because there is no overload method given for indexes.

Code snippet is given below which may help to understand the issue.



5 Replies 1 reply marked as answer

MR Manikandan Ravichandran Syncfusion Team July 6, 2020 08:54 AM UTC

Hi Ayaz,

Thank you for contacting Syncfusion support.

From the given details, we have found that your requirement is to set slide index number in the SetHyperlink method. Yes, you can set slide index number in the hyperlink field as a string and its working fine in our end. Kindly refer the below code example for your requirement.

 
Presentation presDoc = Presentation.Create();
ISlide slide1 = presDoc.Slides.Add(SlideLayoutType.Blank);
ISlide slide2 = presDoc.Slides.Add();
ISlide slide3 = presDoc.Slides.Add();
ISlide slide4 = presDoc.Slides.Add();
IShape shape = slide1.Shapes.AddShape(AutoShapeType.Rectangle, 100, 20, 200, 100);
//Set the slide index as hyperlink
shape.SetHyperlink("3");
//Save the presentation to the file system
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close(); 

If you still facing the issue means, kindly share the complete sample along with the input document which will helpful us to provide you the appropriate solution at the earliest.

Please let us know if you have any further questions.

Regards,
Manikandan Ravichandran



AA Ayaz Ali replied to Manikandan Ravichandran July 6, 2020 12:31 PM UTC

Hi Ayaz,

Thank you for contacting Syncfusion support.

From the given details, we have found that your requirement is to set slide index number in the SetHyperlink method. Yes, you can set slide index number in the hyperlink field as a string and its working fine in our end. Kindly refer the below code example for your requirement.

 
Presentation presDoc = Presentation.Create();
ISlide slide1 = presDoc.Slides.Add(SlideLayoutType.Blank);
ISlide slide2 = presDoc.Slides.Add();
ISlide slide3 = presDoc.Slides.Add();
ISlide slide4 = presDoc.Slides.Add();
IShape shape = slide1.Shapes.AddShape(AutoShapeType.Rectangle, 100, 20, 200, 100);
//Set the slide index as hyperlink
shape.SetHyperlink("3");
//Save the presentation to the file system
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close(); 

If you still facing the issue means, kindly share the complete sample along with the input document which will helpful us to provide you the appropriate solution at the earliest.

Please let us know if you have any further questions.

Regards,
Manikandan Ravichandran


I need to create hyperlink for first slide.
I believe issue is with index 0. can you try running below code and see if link works for first slide.



        IPresentation presDoc = Syncfusion.Presentation.Presentation.Create();
        ISlide slide1 = presDoc.Slides.Add(SlideLayoutType.Blank);
        ISlide slide2 = presDoc.Slides.Add();
        ISlide slide3 = presDoc.Slides.Add();
        ISlide slide4 = presDoc.Slides.Add();
        IShape shape = slide3.Shapes.AddShape(AutoShapeType.Rectangle, 100, 20, 200, 100);
        //Set the slide index as hyperlink
        shape.SetHyperlink("0");
        //Save the presentation to the file system
        presDoc.Save("Output.pptx", FormatType.Pptx, Response);
        //Close the presentation
        presDoc.Close();

Attachment: Output_a6dfb2ec.zip


MR Manikandan Ravichandran Syncfusion Team July 7, 2020 07:16 AM UTC

Hi Ayaz,

Thank you for your update

We can reproduce the reported issue with “SetHyperlink now working properly for first slide in presentation document” in our end, and we suspect it to be a defect. We will validate this issue and update you with more details on 9th July 2020.

Please let us know if you have any other questions.

Regards,
Manikandan Ravichandran



MR Manikandan Ravichandran Syncfusion Team July 9, 2020 03:25 PM UTC

Hi Ayaz,

Thank you for your patience.

We have confirmed that the reported issue with “SetHyperlink method not working properly for first PowerPoint slide” is a defect and we have logged a defect report. We have planned to include this fix in our weekly NuGet release on 21th July 2020.

The status of this bug task can be tracked through the below link:
https://www.syncfusion.com/feedback/15935/sethyperlink-now-working-properly-for-first-slide-in-presentation-document

Please let us know if you have any other questions.

Regards,
Manikandan Ravichandran
 



MR Manikandan Ravichandran Syncfusion Team October 6, 2020 06:56 AM UTC

Hi Ayaz,

We are glad to announce that our Essential Studio 2020 Volume 3 release v18.3.0.35 is rolled out and is available for download under the following link.

https://www.syncfusion.com/forums/158306/essential-studio-2020-volume-3-release-v18-3-0-35-is-available-for-download

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Regards,
Manikandan Ravichandran


Marked as answer
Loader.
Up arrow icon