Quantcast
Channel: SCN: Message List - SAP PowerDesigner
Viewing all 2877 articles
Browse latest View live

Re: How to get rtf formatted text to Word by vbscript?

$
0
0

Hi Dirk,

 

 

first of all, thanks for your hints. Now please let me explain two things. I cannot format the text in the time of pasting into word document, because it`s been formatted during its creation (when users created and described objects in PowerDesigner). So I need to transfer already formatted text, not to format it during the run-time.

 

 

The second hint is much closer, but I cannot use features, that is offered in full VB environment. I`m restricted to VB SCRIPT running in PowerDesigner. So I`m afraid, I cannot use those functions in General declarations section. Or, if it could be used, can you please explain me how? I have no experience with this.

 

 

Anyway, thanks a lot for your reply and looking forward for your future post.


Re: Reuse entity attributes by script

$
0
0

Hello,

most likely what you did was not making new attributes but copy the "pointer" from Ent1 to ent2 ,

 

here is some code which should work:

 

 

Option Explicit

Dim pd_App As PdCommon.application

 

 

Function copy_table(thename As String, newname As String)

Set pd_App = New PdCommon.application

Dim InputModel As PdCDM.model
Set InputModel = pd_App.OpenModel("U:\PD_Modelle\cdmtest.cdm")


Dim tc, t As PdCDM.Entity
Dim col As PdCommon.ObjectBag

Debug.Print InputModel.DataItems.Count

Set col = InputModel.GetCollectionByName("Entities")
  

For Each t In col
        Output ">" & t.Code
       
       
            If t.Code = thename Then
            Dim a, ac As PdCDM.EntityAttribute
            Set tc = InputModel.Entities.CreateNew(cls_Entity)
            tc.Code = newname
            For Each a In t.Attributes
                Set ac = tc.Attributes.CreateNew(cls_EntityAttribute)
                ac.SetNameAndCode a.Code, a.Code

               '' copy here other stuff u need !


            Next a
            Output "ec-->" & tc.name & "  -  " & tc.ClassName & tc.UOL
            End If
           
Next t

End Function

 

 


Re: How to get rtf formatted text to Word by vbscript?

$
0
0


Hi,

you can use nearly ANY enviroment from VB in VBS, see my BLOGS from last year,

same as you register WORD, you can register OTHER DLL´s and use them, its a little tricky but will work.

you  should maybee looking for the newest word docs and poists, the one i found was just an example and maybe to old ( 10 years?) it might be that newer word version have a function to recieve RTF

 

in WORST case you write the insert function to the clipboard and back to The worddocument as a VBA function in WORD or ACCESS or EXCEL, then call this one  from Powerdesigner VBS.

 

cheers

dirk

Re: How to get rtf formatted text to Word by vbscript?

$
0
0

Hi again,

what if you save every piece ( or all peaces together?) into a file with name xyz.rtf

you need to ensure that there is a valid header footer?

and the read it into word ( vbs from PD!) with objWord.document.Range.ImportFragment(filename)

 

 

haven´t test this, but might be a way

Re: Reuse entity attributes by script

$
0
0

Thank you guys for your answers.

 

I think that i didn't explain well my needs.

 

I don't want to copy an entity to another, neither create new attributes. I have some attributes which are common between all my entities, until now, for each new entity, i use the reuse data items button to add those attributes, but now i want to make it simple and faster. So i created an event handler on my entities, and i want to reuse those data items and not create new attributes with the same code and name and comment ...

Re: Reuse entity attributes by script

$
0
0

but the code i provided you will help you to do it this way,

you just select from another source like activemodel.dataitems, but as far as i Understand thge dataitems, its only a (distinct) set of all attributes and it doesn´t matter if you crate an attribute by code, cloning another attribut or using the dataitem.

 

anyway, why you dont post your code so far instead of let us guessing what you want?

Re: Reuse entity attributes by script

$
0
0

My code is :

 

Function %Initialize%(obj)

 

For each T in ActiveModel.Entities

     If T.Code = "Items_Entity" Then

          For each col in T.Attributes

               Set new_attr = obj.Attributes.CreateNew(col)

               obj.Attributes.Add(new_attr)

          Next

     End If

Next

 

%Initialize% = True

End Function

Re: How to get rtf formatted text to Word by vbscript?

$
0
0

Yes, this is the olny procedure so far, that should work (each RTF piece in separate file, interpret it in  temporary Word document and copy it to the final document). But imagine doing this in the model with 800 tables and thousands of columns. And each of these objects has Description and Annotation. I`m looking for a way how to do this without the neccessity of creating thousands of files.


Re: How to get rtf formatted text to Word by vbscript?

$
0
0

if you analyse the rtf pieces and cut /begindoc   /enddoc then you can save more in one file.

the beginning of a rtf is like that:

 

{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033 and then followed by {......} and a final }

 

so when you cut this header and footer you can put more in one file

 

also you should process in a loop on the fly so you can use always the same tempfiel and you can import imideatly to the final doc with importfragment.

Re: LOCAL/STANDALONE/UNSERVED Licenses for PowerDesigner 16.5

$
0
0

Thank you, Arnaud, for your consistently prompt and helpful answers on this Forum. 


Unfortunately PowerDesigner 16.5 is not available on the Sybase Product Download Center.  The last release on that site is 16.1.  It would have been useful for this information to have been imparted to unserved license customers some time ago in the form of a bulletin or a "How to migrate from SYBASE to SAP" tutorial.  The December 2013 16.5 SP03 Installation Guide still documents the local standalone license as a valid option (please see page 11).  There may be a revision in order.

 

Best regards,

John

(au-delà des Pyrénées)

 

 

Re: How to get rtf formatted text to Word by vbscript?

$
0
0

But I think this is only working if you have no pictures or other objects embedded in the RTF.

Re: How to get rtf formatted text to Word by vbscript?

$
0
0

I`m afraid, that it is not that simple. Please, look at the following example:

 

testing string

on multiple

rows


this 3-line formatted text looks in RTF-tagged text like this:


{\rtf1\ansi\ansicpg1250\deff0\deflang1029{\fonttbl{\f0\fnil Times New Roman;}{\f1\fnil\fcharset0 Times New Roman;}}

{\colortbl ;\red255\green0\blue0;}

{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\cf1\lang1033\b\f0\fs20 testing string\cf0\f1\par

on multiple\par

\cf1\f0 rows\cf0\b0\f1\par

}

 

Here you can see, that the header contains (besides other things) definitions of colours used in the text. And this is only simple example. There are more things in the header which relate to the text in the body. Trying to cut the headers is like trying to use variables and constants in the code without their declaration.

Re: How to get rtf formatted text to Word by vbscript?

$
0
0

Hi Ondrej

last post before the weekend!

 

 

I produced with ur example:

 

 

  rtfexample.PNG

 

just by cutting :

{\rtf1\ansi\ansicpg1250\deff0\deflang1029

and

most last }

and using the inner part tree times

 

her is ur expample after my modification:

 

{\rtf1\ansi\ansicpg1250\deff0\deflang1029
{\fonttbl{\f0\fnil Times New Roman;}{\f1\fnil\fcharset0 Times New Roman;}}

{\colortbl ;\red255\green0\blue0;}

{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\cf1\lang1033\b\f0\fs20 testing string\cf0\f1\par

on multiple\par

\cf1\f0 rows\cf0\b0\f1\par
{\fonttbl{\f0\fnil Times New Roman;}{\f1\fnil\fcharset0 Times New Roman;}}

{\colortbl ;\red255\green0\blue0;}

{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\cf1\lang1033\b\f0\fs20 testing string\cf0\f1\par

on multiple\par

\cf1\f0 rows\cf0\b0\f1\par
{\fonttbl{\f0\fnil Times New Roman;}{\f1\fnil\fcharset0 Times New Roman;}}

{\colortbl ;\red255\green0\blue0;}

{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\cf1\lang1033\b\f0\fs20 testing string\cf0\f1\par

on multiple\par

\cf1\f0 rows\cf0\b0\f1\par

}

 

 

SO IT WORKS

 

 

Re: How to get rtf formatted text to Word by vbscript?

$
0
0

Header is only this: {\rtf1\ansi\ansicpg1250\deff0\deflang1029

 

footer is only the mostlast }

Re: How to get rtf formatted text to Word by vbscript?

$
0
0

Hi Dirk,

 

I appreciate the time and energy, your putting into this problem. But I`m afraid that IT IS NOT WORKING when using more than simple formatting. For example here are two texts, more colours.

 

testing string

on multiple

rows


Another text

different colour


And if you use your procedure for this text, here is the RTF-tagged resulting text (this is the header: {\rtf1\ansi\ansicpg1250\deff0\deflang1029 ):

 

 

{\rtf1\ansi\ansicpg1250\deff0\deflang1029{\fonttbl{\f0\fnil Times New Roman;}{\f1\fnil\fcharset0 Times New Roman;}}

{\colortbl ;\red255\green0\blue0;}

{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\cf1\lang1033\b\f0\fs20 testing string\cf0\f1\par

on multiple\par

\cf1\f0 rows\cf0\b0\f1\par

 

{\fonttbl{\f0\fnil Times New Roman;}{\f1\fnil\fcharset238{\*\fname Times New Roman;}Times New Roman CE;}{\f2\fnil\fcharset0 Times New Roman;}}

{\colortbl ;\red0\green255\blue64;\red0\green0\blue255;}

{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\cf1\lang1033\b\f0\fs20 A\lang1029\f1 nother text\par

\cf2\f0 different colour\cf0\lang1033\b0\f2\par

}

 

And here is the interpreted result:

testing string

on multiple

rows

Another text

different colour

 

 

I wonder if there is completely different solution (some RTF library for example), that would give me the option to transfer RTF text without all these partial and lengthy steps.

 

Regards,

Ondrej


Re: How to get rtf formatted text to Word by vbscript?

$
0
0

You should ask this Questions now  to the Microsoft Word forums, it might be that they have a solution for you. You still have the option of importfragment. I am out of options for you now....

Re: Error en ejecucion de power designer 16.5

$
0
0

But what I do not know if the trial version is also licensed with because I find no. Lic

Re: Error en ejecucion de power designer 16.5

$
0
0

You must provide a valid license file to be able to work with PowerDesigner for more than 2 weeks..

You do not need to uninstall the current version even if it's an evaluation version.

Just go to Tools > License Parameters, select the suitable license type and provide the license you have generated/have been provided.

 

Also see the installation guide:

http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc38092.1650/doc/html/rad1232023292093.html

http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc38092.1650/doc/pdf/installation.pdf

 

HTH

Re: How to get rtf formatted text to Word by vbscript?

$
0
0

Anyway, thanks a lot for your help. It helped me to sort out my options and I think i finally picked up my solution. I will create certain number of temp rtf files, but I don`t need to open them manually for copying the RTF content, but I can use the InsertFile method to insert the RTF text on its proper place. Here is the command.

 

objTable.Cell(3,2).Range.InsertFile "C:\table_1_desc.rtf", ,false

 

Thanks again to all participants in this topic.

 

Ondrej

Re: How to get rtf formatted text to Word by vbscript?

$
0
0

Have you tried using the Rtf2Ascii(rtf As String) function documented in the PowerDesigner Metamodel Objects Help?  By definition, this global function removes RTF tags from an RTF formatted text.

 

Regards,

 

Anthony

Viewing all 2877 articles
Browse latest View live