How to paste content from system Clipboard to an OLE control inserted by Microsoft RichText Control in powerbuilder 6.5? - ole

a powerscript example in PB6.5 :
ole=Create OleObject //create an ole control
ole.ConnectToNewObject("word.application") //connect the ole to word app
ole.Documents.Open(ls_path) //open an winword using the path "ls_path"
ole.Selection.WholeStory //ctrl+A
ole.Selection.copy() //copy the content to system clipboard
And now I want to paste this content to another ole control(such as ole_1) connected with Microsoft RichText Control, but I don't know how to do...
That is to say, I can use mouse or use ctrl+V to paste the content successfully, and i cannot find the specific function to complete the operation.
Or is there any document describing the Microsoft Richtext control(version 5.0 in PB6.5)?
Thx!

see Implementing the Microsoft Rich Edit Control, by Bruse Armstrong & Demetrios Tsakiris, PowerBuilder Developer's Journal, August 2005

Related

copy qt scene to clipboard as a PowerPoint object

I was wondering if anyone knew the first thing about copying a qt scene to the clipboard and then being able to paste it into word as a grouped object. All I have in my scene are graphics text items, ellipses, and lines. It seems like something that could be made into shapes and lines and text that could be pasted into powerPoint as a group. I don't know where to start! Any ideas? Thanks!
I would attack this in two ways:
From the system perspective and from the office sdk perspective.
From the system perspective you are talking about the clipboard, mime types, and exactly what is stored in the clipboard, exactly.
From the office sdk perspective, you are talking about how it stores the pre-rendered elements.
Just from a quick look around, I found this info in the MS Office SDK:
http://msdn.microsoft.com/en-US/library/office/gg278315
http://msdn.microsoft.com/en-US/library/office/cc850847
and this on Clipboard managers:
http://en.wikipedia.org/wiki/Clipboard_manager
and this for the Qt connection to the clipboard:
http://qt-project.org/doc/qt-4.8/qclipboard.html#details
Now... from that start, I wrote this little bit of code:
I added a QPushButton and a QTextEdit to a MainWindow UI Form. Then I went to the slot of the Push Button and put the following:
void MainWindow::on_pushButton_clicked()
{
ui->textEdit->clear();
QClipboard *c = QApplication::clipboard();
foreach(QString format, c->mimeData()->formats())
{
ui->textEdit->append(format);
ui->textEdit->append(c->mimeData()->data(format));
}
ui->textEdit->append("done");
}
I copied an oval and a rectangle from PowerPoint in Office 2010,
and then used the push button in my program. This is the output it gave me:
application/x-qt-windows-mime;value="Preferred DropEffect"
application/x-qt-windows-mime;value="InShellDragLoop"
application/x-qt-windows-mime;value="PowerPoint 12.0 Internal Shapes"
ÀN
application/x-qt-windows-mime;value="Object Descriptor"
j
application/x-qt-windows-mime;value="Art::GVML ClipFormat"
PK
application/x-qt-windows-mime;value="PNG"
PNG
application/x-qt-image
application/x-qt-windows-mime;value="JFIF"
ÿØÿà
application/x-qt-windows-mime;value="GIF"
GIF89aã
application/x-qt-windows-mime;value="PowerPoint 12.0 Internal Theme"
Hý©
application/x-qt-windows-mime;value="PowerPoint 12.0 Internal Color Scheme"
Pý©
done
So it should be do-able, but you would need to figure out what is some of the stuff they are encoding in between the readable clear text.
Hope that helps.
PS You may have better luck trying to save the Qt elements as an SVG object or some other image on the clipboard.

How to use ReportingCloud in asp.net web site?

Recently I have started to work with SSRS and found ReportingCloud. It says
ReportingCloud provides an open source quality implementation
as an extension of the RDL specification
I haven't found any tutorial/documentation on how to use it in sourceforge or via google search.
Can anyone give an walk-through/example on How to use ReportingCloud?
There is one partial example available at http://sourceforge.net/projects/reportingcloud/forums/forum/1116661/topic/4571059.
The example takes an existing RDL file, parses and executes it and then places the HTML output into an asp.net Literal Control for display in the browser.
That code snippet is repeated here:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("C:\MyFolder\MyReport.rdl");
RDLParser rdlp = new RDLParser(xmlDoc.OuterXml);
rdlp.Parse();
MemoryStreamGen ms = new MemoryStreamGen();
ProcessReport pr = new ProcessReport(rdlp.Report, ms);
pr.Run(null, OutputPresentationType.ASPHTML);
// Dump memory stream (HTML Text) to an out-of-box ASPX Literal control
this.LiteralReportHtml.Text = ms.GetText();
To do this you'll need a reference to ReportingCloud.Engine.
I'm not sure exactly what your bigger goals are but I'd like to draw your attention to another open source project on GitHub called My-FyiReporting https://github.com/majorsilence/My-FyiReporting
Just like ReportingCloud, My-FyiReporting is a fork of FyiReporting (which has gone dormant).
The big difference as far as you are concerned is that My-FyiReporting has ASP.NET samples and an ASP.NET user control link. This might be the fast way to get to what you need.
File ORIGINALPROJECT.TXT from ReportingCloud says:
The ReportingCloud is a fork from the original project fyiReporting
4.1 (http://www.fyireporting.com).
File readme.md from My-FyiReporting says:
My-FyiReporting is a fork of fyiReporting. I cannot stress this
enough. This is a FORK. The main purpose is to make sure that I have a
copy of fyiReporting since that project seems to be dead.

push external multimedia file in to package at tridion publish time

When we publish some page/dynamic component from tridion is it possible to add some external multimedia file/content(ex:jpg image) in to current executing/rendering package at publish time.So that final transportation package has this binary file present along with original published content?
Is this achivable using customization of tridion renderer/resolver?If yes please provide some inputs.
*Note:*The binary content that needs to be pushed in to package at publish time is not present as multimedia component in tridion, it is located at other file location outside tridion CMS.Instead we have some stub multimedia component being used inside published component/page which has some dummy image. we plan to replace the stub image with original image at publish(rendering/resolving) time.
Since we have huge bulk of binary content stored in DAM tool we dont want that data to be recreated as multimedia component in tridion, insted we want to use that data by querying DAM tool and attach it in to tridion package with some logical referencesplanning to maintain one to one mapping between stub multimedia comp tcmid to original content in some mapping DB for reference).
Please let us know if any solution is there to attach external binary content to package at publish time.
The best - and easiest way - is to use the mechanism provided by Tridion out-of-the-box for this. Create a new multimedia component, select "External" in the resource type drop-down, and type the URL to the object. As long as you can address it with a URL, it will work exactly as you want (item will be added to package and sent to delivery server).
If this is not good enough for you, then yes, you can add it to the package yourself. I've done this in the past with code somewhat like this:
FileInfo file = // Weird logic to get a FileInfo object from external system
Item item = package.GetItem("My original Item");
item.SetAsStream(file.OpenRead());
This replaced the content of my original component with the actual file I wanted. This will work for you IF the original component is also a multimedia component. If it's not, just create a new item with your own name, etc. If possible, do use the out-of-the-box process instead.
PS: FileInfo Class.
As Nuno suggested the best way is to use multimedia component with 'External' resource type. You may not need to create these manually, you can automate using core services or API programs.
Another way I used before to create zip file at run time and add same to package with following code. Hope it may help.
using (MemoryStream ms = new MemoryStream())
{
zip.Save(ms);
downloadAllInOneURL = String.Format("ZipAsset{0}.zip", uniqueZipID);
downloadAllInOneURL = m_Engine.PublishingContext.RenderedItem.AddBinary(ms, downloadAllInOneURL, "", "application/zip").Url;
downloadAllInOneSize = getSize(ms.Length);
}

CurrentWorkItem.ID is correct or not in workflow script editor?

I am using Tridion 2011 SP1, And I am creating workflow like start-->create-->Review-->publish--Stop.
I created and registered the class library, and invoke the C# method using VBscript (Script Editor of WF Tab) as given below.
Option Explicit
Dim workflowHandler
Set workflowHandler= CreateObject("CoreComponentWorkflow.WorkflowHandler")
If Not workflowHandler Is Nothing Then
Call workflowHandler.PublishComponent(Cstr(CurrentWorkItem.ID))
FinishActivity "Published to WIP"
End If
Set workflowHandler= Nothing
Is the above code is correct? I am sure I am able to create object using the below line.
Set workflowHandler= CreateObject("CoreComponentWorkflow.WorkflowHandler")
And currently I am publishing the current item only using the C# code, am calling the C# function as below.
Call workflowHandler.PublishComponent(Cstr(CurrentWorkItem.ID))
After publishing the item, I am finishing the activity using below.
FinishActivity "Published to WIP"
I have checked the above code directly in the server by hard coding the currentworkitem, it was working fine. But when I put the same code in vbscript editor, the item is not published.
Can any one suggest on this?
When you hardcode you might be adding the TCM ID directly so it is working properly, which means that CurrentWorkItem.ID is not the correct API call to get the Component ID. See Igor comment below to get the tcm id.

Alternative to Excel as ASP.Net Report Generator

I use excel through vb.net/asp.net to generate reports from a web page and then send the file down to the user. We've had some issues with Excel being super slow/inefficient/not closing (even when we keep track of the process id and try to kill it in code...). So I'm looking for some flexible alternatives. We need a replacement that can:
Allow for inidivdual cell formatting including borders (different settings on each side), background colors, font styles/coloring, etc...
Allow for cell merging
Allow for formatting (bolding in this case) of a portion of the text inside of a cell while leaving the rest of the text unchanged
Image insertion/repositioning inside a cell (not crucial)
Multiple Worksheets per Workbook
These are all the features I can think of off hand, any help or suggestiong at alternative libraries to look at would be appreciated. We are running Excel 2007 on the server but we are rolling out Office 2010 to clients so I think that might open the doors for some more supported file formats, if that helps.
After looking through the various options and performing more independent research I ended up using EPPlus, which you can get # http://epplus.codeplex.com.
Thanks for all the suggestions.
I recommend you to use the DevExpress.XtraReports from DevExpress. It is a Licensed product, but offers you a friendly toolkit for generating great and complexity reports. It is well documented and easy to use, once you define a template (REPX) you can populate it with data by assigning to each element a value as well as using [mail merge] feature which will be automatically replaced once you bind with data the report. In the core of such technology is a well OO design of classes. Once you generate the report you can export it to the most common formats: XLS, HTML, PDF, RTF...
public void GenerateReportFile(string rptFileName, string param1, int param2)
{
XtraReport report = null;
try
{
report = new XtraReport();
//-- loads the layout template (repx file)
report.LoadLayout("SomeDirectory\report_template.repx");
//-- assign data to report controls
report.FindControl("Label1", true).Text = string.Format("{0:dd/MM/yyyy}", fecha1);
report.FindControl("Label2", true).Text = string.Format("{0:dd/MM/yyyy}", fecha1);
//-- gets data from some Data Acces Layer method and assig it to the report DataSource property
DALReport dal = new DALReport();
report.DataSource = dal.GetReport1Data(ExpEmp, param1, param2);
report.DataMember = "data";
report.ExportToPdf(rptFileName, options);
}
catch { throw; }
finally { if (report != null) { report.Dispose(); } report = null; }
}
For more information refers to: http://demos.devexpress.com/XtraReportsDemos/
There is another free library for .Net iTextSharp, this library
was originally written for Java, then was translated to C# for .Net
usage. The library is mainly for PDF documents creation but some
versions also supports XLS documents creation.
GNU plot is a little bit of a pain to get to run on windows but it is a an awesome tool
It sounds like you are using a library that opens Excel and uses MS Office Excel objects to create the Excel file. Since you are using 2007 and above, you may want to consider creating the Excel file manually using a library that creates the XML (therefore, Excel doesn't open at all).
Check out ExcelLibrary.
While doing a search on this, I found this page (on StackOverflow) that provides some sample code.
Office Web Components (though dated) is free and has worked for me in the past.
If you want to spend the loot, Aspose Cells is a good way to go also.

Resources