This is a migrated thread and some comments may be shown as answers.

Export to PDF of Calendar that has had its Appointments customized

7 Answers 47 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Brent Hetland
Top achievements
Rank 1
Brent Hetland asked on 21 Sep 2015, 03:32 PM

Hi,

I use version 2015.01.401 of your controls.

In the RadScheduler_AppointmentCreated Event, I customize the subject of the Appointment with the code below:

 

AppointmentLinkButton.Text = String.Concat(e.Appointment.Subject, " - <i>(", DivisionName, " - ", OwnerName, ")</i>")

Dim emEventID As String = e.Appointment.Attributes("emEventID")

AppointmentLinkButton.PostBackUrl = EMLink.Url((Cbs.Data.SD.NavTreeObjectTypes.EventDetails).ToString(), emEventID)

Dim tooltipValueParam As String = String.Concat(emEventID, PIPE_DELIMETER, SessUserCultureCode, PIPE_DELIMETER, SessUserID)

Dim jscript As String = "javascript:showProjectToolTip(this,'" & tooltipValueParam & "');"

Dim jscriptClearTimer As String = "javascript:clearTimeout(timer1);"

ImagesLiteralControl.Text = String.Format(APPTSUBJECTIMAGESTRING_CONST, "../../img/icons/event-bricks_small.png", jscript, jscriptClearTimer) ​

e.Appointment.BackColor = System.Drawing.ColorTranslator.FromHtml(e.Appointment.Attributes("DivisionChartHexColor"))

AppointmentLinkButton.ForeColor = GetIdealTextColor(e.Appointment.BackColor)

 

You can also see that I have code in that event that sets the background color of the appointments, based on user configurable colors stored in our database (they are not in CSS files).  I've attached the SchedulerInWebApp.png file to show you what it looks like in the web app.  The image that is there, uses a radtooltip manager to call a web service to display more information.  And the actual text is a link to the item in our system.

My problem is that when I do an export to PDF, the image isn't found and the subject contains no text.  I've attached the SchedulerPDFOutput.png to show that.

Question:  How can I get the Export to NOT try to embed the image, and have it just display the custom text that I am creating?

Thanks in Advance,

Brent

7 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 24 Sep 2015, 07:47 AM
Hello,

In such cases we recommend using custom style sheet file to the export so that the custom styles are applied there too.

Hope this will help you solve the issue.

Regards,
Plamen
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Brent Hetland
Top achievements
Rank 1
answered on 25 Sep 2015, 10:26 AM

Hi Plamen,

No, that does not solve my issue.  Can someone please read my original post again?

I customize the Appointment's using a template, during AppointmentCreated.  When I export, I want to appointments to retain the new subject and background color I give them.  They currently retain the color, but the control's (a link button) text is not displayed.

If you have questions as to what I'm doing or what problem I'm having, please ask me to clarify.  Don't just post a generic response, hoping that it answers my question.

Thanks,

Brent

0
Plamen
Telerik team
answered on 25 Sep 2015, 01:31 PM
Hi Brent,

In this case we when you need you export an image in the template we recommend using some CSS class and add the background -image from the CSS as for example it is done in the attached page.

Regards,
Plamen
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Brent Hetland
Top achievements
Rank 1
answered on 25 Sep 2015, 01:38 PM

Hi Plamen,

You are still not understanding.  I do NOT want to export the image.  I only want to display the image in the web page, which I am not having a problem with.

Look at the pictures I attached.  My main problem is:

1)  I use a template that has an image.  When I export, I don't want to display the image.

2)  I DO still want to show the label from my template, which shows a modified version of the appointment's subject.

Perhaps one of your co-workers can read my thread and better understand.

I'm not trying to be rude, but you aren't understanding and this "back and forth" is just costing time for both of us, without answering the question.

Thanks,
Brent

0
Plamen
Telerik team
answered on 28 Sep 2015, 05:34 AM
Hi,

If you want to only view the image in the web page and not in the PDF you can use the same approach by setting the image with a css class and CSS rule but without using the CSS file in the StyleSheets PDF setting. This way the style will not be applied and the image will not be seen.

Regards,
Plamen
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Brent Hetland
Top achievements
Rank 1
answered on 28 Sep 2015, 10:10 AM

But in code, how do I tell I am exporting versus posting back to the page?  I'd need to know that in order to NOT display the image when exporting.

And you still haven't answered my question as to why my custom appointment subject is not appearing.

With regards to your answers on this forum post, I must say that this is the most frustrating forum post I've ever had.  I'd say that 99% of the time I've asked a question in Telerik's forums, I'm very satisfied with the answers I get.  In this case, I'm frustrated with the lack of understanding and very incomplete answers.

0
Plamen
Telerik team
answered on 01 Oct 2015, 10:53 AM
Hello,

It seems that I could not explain correctly - please excuse me for that. The suggested approach for this case is to associate the controls inside the template with a CSS class as in the attached project and assign the image for them in the CSS style for this class. This way when yo export to PDF the images they will not be seen and you will not have to differentiate between different postbacks. Yet it you do not include  StyleSheets PDF setting they will not be applied on the PDF

The images will only be seen in the web page and the updated text of the appointment  will be seen too.

Hope this will help you solve the issue. 

Regards,
Plamen
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Scheduler
Asked by
Brent Hetland
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Brent Hetland
Top achievements
Rank 1
Share this question
or